Giter Club home page Giter Club logo

Comments (7)

rachitpant avatar rachitpant commented on May 26, 2024

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.

from vue-confirm-dialog.

aslanon avatar aslanon commented on May 26, 2024

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()
         }
       }
     )
   },

from vue-confirm-dialog.

rachitpant avatar rachitpant commented on May 26, 2024

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.

from vue-confirm-dialog.

KevinLevesque avatar KevinLevesque commented on May 26, 2024

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?

documentClick(e) {
try {
let el = this.$refs.vueConfirm;
let target = e.target;
if (el !== target && !el.contains(target)) {
this._emit("close");
}

from vue-confirm-dialog.

matteogll avatar matteogll commented on May 26, 2024

I have the same issue.
The confirmation dialog apper for just few seconds, and then disappear without clicking

from vue-confirm-dialog.

aslanon avatar aslanon commented on May 26, 2024

I'm working on the new version. I will solve this bug in a short time.

from vue-confirm-dialog.

aslanon avatar aslanon commented on May 26, 2024

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

from vue-confirm-dialog.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.