You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
775 B

5 years ago
Component({
properties: {
5 years ago
data:{
type:Object,
observer: function(){
this.setData({value:false});
}
},
select: {
type: Boolean,
value: false,
observer: function(v){
5 years ago
;
if(!v){
this.setData({value: false});
5 years ago
;
}
}
}
5 years ago
},
behaviors: ['wx://form-field'],
5 years ago
data: {
eduUrl: global.config.eduUrl
},
methods: {
onTap(){
if(this.data.select){
this.select({from:"body"})
}
},
select({from}){
this.setData({value: !this.data.value});
let {data:{id:name}, value} = this.data;
this.triggerEvent("select", {name, value, from}, {bubbles:true});
},
onTapRadio(){
this.select({from:"radio"})
}
5 years ago
}
})