vuejs dialog not working from ts file

404 Points
167 Posts

I'm using 'vuejs-dialog' to open confirmation box. And I'm following

I'm try to use following code in vuejs i.e on ts file:

// Trigger an Alert dialog
this.$dialog.alert('Request completed!')
    .then(function (dialog) {
// Trigger a confirmation dialog
this.$dialog.confirm('Please confirm to continue')
    .then(function (dialog) {
        console.log('Clicked on proceed')
    .catch(function () {
        console.log('Clicked on cancel')

But it's not working for me and throwing error: "$dialog not available"

Although, It's working fine in html page:

// While looping through users
<button v-for="user in users"
            loader: true,
            ok: dialog => makeAdmin(dialog, user),
            cancel: doNothing,
            message: 'User will be given admin privileges. Make user an Admin?'}"
Make Admin

I don't know what is happening.


Views: 9205
Total Answered: 0
Total Marked As Answer: 0
Posted On: 21-Sep-2018 02:26

Share:   fb twitter linkedin
 Log In to Chat