仿互站小程序
This commit is contained in:
42
vant/switch-cell/index.js
Normal file
42
vant/switch-cell/index.js
Normal file
@@ -0,0 +1,42 @@
|
||||
(0, require("../common/component").VantComponent)({
|
||||
field: !0,
|
||||
props: {
|
||||
value: null,
|
||||
title: String,
|
||||
border: Boolean,
|
||||
checked: Boolean,
|
||||
loading: Boolean,
|
||||
disabled: Boolean,
|
||||
activeColor: String,
|
||||
inactiveColor: String,
|
||||
size: {
|
||||
type: String,
|
||||
value: "24px"
|
||||
},
|
||||
activeValue: {
|
||||
type: null,
|
||||
value: !0
|
||||
},
|
||||
inactiveValue: {
|
||||
type: null,
|
||||
value: !1
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
checked: function(e) {
|
||||
this.set({
|
||||
value: e
|
||||
});
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
this.set({
|
||||
value: this.data.checked
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onChange: function(e) {
|
||||
this.$emit("change", e.detail);
|
||||
}
|
||||
}
|
||||
});
|
15
vant/switch-cell/index.json
Normal file
15
vant/switch-cell/index.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-cell": "../cell/index",
|
||||
"van-switch": "../switch/index",
|
||||
"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"
|
||||
}
|
||||
}
|
3
vant/switch-cell/index.wxml
Normal file
3
vant/switch-cell/index.wxml
Normal file
@@ -0,0 +1,3 @@
|
||||
<van-cell center border="{{border}}" customClass="van-switch-cell" title="{{title}}">
|
||||
<van-switch activeColor="{{activeColor}}" activeValue="{{activeValue}}" bind:change="onChange" checked="{{checked}}" customClass="van-switch-cell__switch" disabled="{{disabled}}" inactiveColor="{{inactiveColor}}" inactiveValue="{{inactiveValue}}" loading="{{loading}}" size="{{size}}"></van-switch>
|
||||
</van-cell>
|
10
vant/switch-cell/index.wxss
Normal file
10
vant/switch-cell/index.wxss
Normal file
@@ -0,0 +1,10 @@
|
||||
@import "../area/index.wxss";
|
||||
|
||||
.van-switch-cell {
|
||||
padding-top: 9px;
|
||||
padding-bottom: 9px;
|
||||
}
|
||||
|
||||
.van-switch-cell__switch {
|
||||
vertical-align: middle;
|
||||
}
|
Reference in New Issue
Block a user