仿互站小程序
This commit is contained in:
35
vant/checkbox-group/index.js
Normal file
35
vant/checkbox-group/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
(0, require("../common/component").VantComponent)({
|
||||
field: !0,
|
||||
relation: {
|
||||
name: "checkbox",
|
||||
type: "descendant",
|
||||
linked: function(e) {
|
||||
var a = this.data, n = a.value, d = a.disabled;
|
||||
e.set({
|
||||
value: -1 !== n.indexOf(e.data.name),
|
||||
disabled: d || e.data.disabled
|
||||
});
|
||||
}
|
||||
},
|
||||
props: {
|
||||
max: Number,
|
||||
value: Array,
|
||||
disabled: Boolean
|
||||
},
|
||||
watch: {
|
||||
value: function(e) {
|
||||
this.getRelationNodes("../checkbox/index").forEach(function(a) {
|
||||
a.set({
|
||||
value: -1 !== e.indexOf(a.data.name)
|
||||
});
|
||||
});
|
||||
},
|
||||
disabled: function(e) {
|
||||
this.getRelationNodes("../checkbox/index").forEach(function(a) {
|
||||
a.set({
|
||||
disabled: e || a.data.disabled
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
13
vant/checkbox-group/index.json
Normal file
13
vant/checkbox-group/index.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-icon": "../icon/index",
|
||||
"forview": "/utils/forview/index",
|
||||
"van-loading": "/vant/loading/index",
|
||||
"van-dialog": "/vant/dialog/index",
|
||||
"van-button": "/vant/button/index",
|
||||
"van-popup": "/vant/popup/index",
|
||||
"van-tab": "/vant/tab/index",
|
||||
"van-tabs": "/vant/tabs/index"
|
||||
}
|
||||
}
|
1
vant/checkbox-group/index.wxml
Normal file
1
vant/checkbox-group/index.wxml
Normal file
@@ -0,0 +1 @@
|
||||
<slot></slot>
|
1
vant/checkbox-group/index.wxss
Normal file
1
vant/checkbox-group/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
@import "../area/index.wxss";
|
Reference in New Issue
Block a user