我正在尝试在我的项目中使用来自“bootstrap+vue”的modal。
现在这可能是一个基本的问题,但是在找了一会儿之后,我没有找到任何答案,所以我会继续问下去。
考虑以下模式
<b-modal ref="myModalRef" @ok="handleOk">
Are You Sure You Want To Delete?
</b-modal>
所以,如果我想处理
ok
按钮是直着的
export default {
methods: {
handleOk: function() {
alert('alert form table - ok is pressed!!')
}
}
}
但是,在我的案例中,我有以下场景,我想知道我的
deleteRow
具有以下知识的功能
person
与把手相反
人
不可知论者:
deleteRow: function(person){
//show dialog
this.$refs.myModalRef.show()
// it would be nice to know here what was pressed
if (okpressed)
actuallyDetele(person)
}
换句话说,我在寻找类似
confirm
但是我想使用模态。
var r = confirm("Are You Sure You Want To Delete?");
if (r == true) {
// continue
} else {
//do nothing
}
有什么建议我可以用模态来实现。
谢谢。