仿互站小程序
This commit is contained in:
43
vant/radio-group/index.js
Normal file
43
vant/radio-group/index.js
Normal file
@@ -0,0 +1,43 @@
|
||||
(0, require("../common/component").VantComponent)({
|
||||
field: !0,
|
||||
relation: {
|
||||
name: "radio",
|
||||
type: "descendant",
|
||||
linked: function(e) {
|
||||
var a = this.data, d = a.value, n = a.disabled, i = a.checkedClass;
|
||||
e.set({
|
||||
value: d,
|
||||
disabled: n || e.data.disabled,
|
||||
checkedClass: i
|
||||
});
|
||||
}
|
||||
},
|
||||
props: {
|
||||
value: null,
|
||||
disabled: Boolean,
|
||||
checkedClass: null
|
||||
},
|
||||
watch: {
|
||||
value: function(e) {
|
||||
this.getRelationNodes("../radio/index").forEach(function(a) {
|
||||
a.set({
|
||||
value: e
|
||||
});
|
||||
});
|
||||
},
|
||||
checkedClass: function(e) {
|
||||
this.getRelationNodes("../radio/index").forEach(function(a) {
|
||||
a.set({
|
||||
checkedClass: e
|
||||
});
|
||||
});
|
||||
},
|
||||
disabled: function(e) {
|
||||
this.getRelationNodes("../radio/index").forEach(function(a) {
|
||||
a.set({
|
||||
disabled: e || a.data.disabled
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
13
vant/radio-group/index.json
Normal file
13
vant/radio-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/radio-group/index.wxml
Normal file
1
vant/radio-group/index.wxml
Normal file
@@ -0,0 +1 @@
|
||||
<slot></slot>
|
1
vant/radio-group/index.wxss
Normal file
1
vant/radio-group/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
@import "../area/index.wxss";
|
Reference in New Issue
Block a user