sweet-modal-vue
sweet-modal-vue copied to clipboard
Confirm modal
Hello,
There is a way to perform confirmation action, like before deleting an element on the page, I'll show a modal popup to confirm the action, like https://sweetalert2.github.io/
Thanks
The way I solve this is with a promise. In your Modal component have an open()
method and have it return a promise. Then have the caller call the open method (using a reference to the modal component) and wait for the promise to resolve. Then have your modal resolve the promise with either false
or true
depending on what the user selected.