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.
|
|
|
|
|
|
|
Component({
|
|
|
|
properties: {
|
|
|
|
data:{
|
|
|
|
type:Object,
|
|
|
|
observer: function(){
|
|
|
|
this.setData({value:false});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
select: {
|
|
|
|
type: Boolean,
|
|
|
|
value: false,
|
|
|
|
observer: function(v){
|
|
|
|
;
|
|
|
|
if(!v){
|
|
|
|
this.setData({value: false});
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
behaviors: ['wx://form-field'],
|
|
|
|
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"})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|