[Vuejs]-How can I make it go down to the bottom lines after the response from the promise is returned in the function?

0👍

You have 2 bugs here: 1) showBoxConfirm doesn’t run a return statement, so it just returns undefined which is falsy, and 2) clickMethod doesn’t know to wait for a response and simply continues immediately after showBoxConfirm returns.

#1 is fixed simply by adding return to the start of your this.$bvModal line – this will return the Promise returned by the catch method. (You could also drop the then and catch calls and just return the Promise returned by msgBoxConfirm.)

To fix #2, I’d make clickMethod an async function and await on the Promise returned by showBoxConfirm. You could also call the Promise’s then method to register a function to call when it resolves.

Leave a comment