[Vuejs]-Vue b-modal @close look like it doesn't work

1👍

According to the documentation, we may consider to add a new function to handle all hide events.

First remove the @cancel="cancelRegister" and @close="cancelRegister" and replace it with @hide=hideRegister.

Add the following in method:

hideRegister(bvModalEvent) {
  const cancelEvents = ['cancel', 'esc', 'backdrop', 'headerclose']
  if(cancelEvents.includes(bvModalEvent.trigger)) {
   this.cancelRegister()
  }
}

Please refer to the documentation for the possible BvModalEvent.trigger values.

Leave a comment