仿互站小程序

This commit is contained in:
Drawfans
2020-06-09 16:17:23 +08:00
commit 7bfd53851e
321 changed files with 22890 additions and 0 deletions

42
vant/switch-cell/index.js Normal file
View 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);
}
}
});

View 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"
}
}

View 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>

View 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;
}