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.

38 lines
748 B

Component({
properties: {
data:Object,
select: {
type: Boolean,
value: false,
observer: function(v){
//console.log("observer select change", v);
if(!v){
this.setData({value: false});
//console.log(this.data);
}
}
}
},
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"})
}
}
})