[Vuejs]-How to pass a user input and update the data using Vue-SweetAlert2

0👍

You have to use promises to get the user input of a swal modal.

async alertDisplay() {
    let customer = await this.$swal({
        title: 'What is your Name?',
        input: 'text',
        inputPlaceholder: 'Enter your name here',
        showCloseButton: true,       
    });
    console.log(customer)
}

You can see it in this Codepen found on the documentation :
https://codepen.io/pen/?&editable=true

Leave a comment