Using with Options API

If you prefer old API, you can use it with Options API inside methods.

For example:

App.vue
import Dialog from './Dialog.vue'
import { createConfirmDialog } from 'vuejs-confirm-dialog'
export default {
data() {
return {
isConfirmed: false
}
},
methods: {
showDialog(){
const dialog = createConfirmDialog(Dialog)
dialog.onConfirm(() => {
this.isConfirmed = true
})
dialog.reveal()
}
}
}