通过使用 :value和 @input 取代 v-model
export default {
data(){
return {
radio: 1
}
},
methods: {
// 手动改变radio值
beforeInputEvent(value){
// 可以在此处做判断
let that = this
this.$confirm('确定改变选项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.radio = value
}).catch(() => {
this.$message({
type: 'info',
message: '已取消选择'
});
});
}
}
}
精彩文章
评论可见,请评论后查看内容,谢谢!!!
发表评论