仿互站小程序
This commit is contained in:
35
vant/tab/index.js
Normal file
35
vant/tab/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
(0, require("../common/component").VantComponent)({
|
||||
relation: {
|
||||
name: "tabs",
|
||||
type: "ancestor"
|
||||
},
|
||||
props: {
|
||||
icon: String,
|
||||
iconStyle: String,
|
||||
dot: Boolean,
|
||||
info: null,
|
||||
title: String,
|
||||
disabled: Boolean,
|
||||
titleStyle: String
|
||||
},
|
||||
data: {
|
||||
width: null,
|
||||
inited: !1,
|
||||
active: !1,
|
||||
animated: !1
|
||||
},
|
||||
watch: {
|
||||
icon: "update",
|
||||
title: "update",
|
||||
disabled: "update",
|
||||
dot: "update",
|
||||
info: "update",
|
||||
titleStyle: "update"
|
||||
},
|
||||
methods: {
|
||||
update: function() {
|
||||
var t = this.getRelationNodes("../tabs/index")[0];
|
||||
t && t.updateTabs();
|
||||
}
|
||||
}
|
||||
});
|
13
vant/tab/index.json
Normal file
13
vant/tab/index.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"forview": "/utils/forview/index",
|
||||
"van-loading": "/vant/loading/index",
|
||||
"van-dialog": "/vant/dialog/index",
|
||||
"van-button": "/vant/button/index",
|
||||
"van-icon": "/vant/icon/index",
|
||||
"van-popup": "/vant/popup/index",
|
||||
"van-tab": "/vant/tab/index",
|
||||
"van-tabs": "/vant/tabs/index"
|
||||
}
|
||||
}
|
4
vant/tab/index.wxml
Normal file
4
vant/tab/index.wxml
Normal file
@@ -0,0 +1,4 @@
|
||||
<view class="custom-class {{utils.bem( 'tab__pane',{active:active,inactive:!active} )}}" style="{{animated||active?'':'display: none;'}} {{width?'width:'+width+'px;':''}}" wx:if="{{animated||inited}}">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<wxs module="utils" src="../wxs/utils.wxs" />
|
15
vant/tab/index.wxss
Normal file
15
vant/tab/index.wxss
Normal file
@@ -0,0 +1,15 @@
|
||||
@import "../area/index.wxss";
|
||||
|
||||
.van-tab__pane {
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.van-tab__pane--active {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.van-tab__pane--inactive {
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
Reference in New Issue
Block a user