ElementUI中el-radio再次点击取消选中
<el-radio-group v-model="radio">
<el-radio :label="1" @click.native.prevent="radioClick(1)">备选项</el-radio>
</el-radio-group>
//prevent阻止默认事件
data(){
return{
radio: '',
}
}
radioClick (e) {
e === this.radio? (this.radio = ''):(this.radio = e)
}
image.png
网友评论