Closed rachitpant closed 4 years ago
If the code in the debugger is too small:
confirmDelete() {
this.$vueConfirm.confirm(
{
auth: false,
message: `Are you sure you want to delete?`,
button: {
no: 'No',
yes: 'Yes'
}
},
function(confirm) {
if (confirm == true) {
this.deleteSelectedUsers()
}
}
)
},
Also I have initialized it correctly , otherwise it wouldn't show. I am using firefox - could this be the issue.
How do you trigger confirmDelete function? Can you use "stop" modifier?
<tag @click.stop="confirmDelete()"> foo </tag>
You also need to define a variable for scope. So your code should be like below.
confirmDelete() {
let self = this
this.$vueConfirm.confirm(
{
auth: false,
message: `Are you sure you want to delete?`,
button: {
no: 'No',
yes: 'Yes'
}
},
function(confirm) {
if (confirm == true) {
self.deleteSelectedUsers()
}
}
)
},
Thanks. I will try this tomorrow. The problem that I think the stop modifier would create is that the action dropdown would not close on click.
The actual event is emitted on click from the child DataTable
component ( a component that is wrapping the datatable , search, pagination and action dropdown that you see above. ) . The emitted event is captured in the parent component that calls the confirmDelete method.
I think I have the same issue.
I have a button which calls a method on click. This method calls this.$vueConfirm.confirm(...) As soon as the dialog opens, it closes immediately.
I found that the documentClick method is launched on every click on the page and seems to be the problem. Maybe we should check if the dialog is open before emiting the close event?
I have the same issue. The confirmation dialog apper for just few seconds, and then disappear without clicking
I'm working on the new version. I will solve this bug in a short time.
This bug is solved the vesion 1.0.1. This version have major changes. Please read to README. README: https://github.com/aslanon/vue-confirm-dialog/blob/master/README.md
RELEASE: https://github.com/aslanon/vue-confirm-dialog/releases/tag/v1.0.1
The confirm action ( with value false ) is being triggered without clicking anywhere.