1

I'm building a vue.js application with Vuetify 1.5.2. I have a v-menu (https://v15.vuetifyjs.com/en/components/menus) on which I would like to hook into a close event. I'm not seeing a close event in the documentation. Does anyone know if there is a close event or something equivalent on the v-menu for Vuetify 1.5.2?

Thanks

gib65
  • 1,709
  • 3
  • 24
  • 58

1 Answers1

0

In version 2 of Vue, I was able to implement this feature by adding an @input event listener to the v-menu component. For example:

<v-menu
  ...
  @input="handleMenuInput"
>

In the corresponding script section:

handleMenuInput(input) {
  const closing = !input;
  if (closing) {
    this.doSomethingYouLike();
  }
}

With this implementation, whenever the v-menu component is interacted with (e.g., opened or closed), the handleMenuInput method will be called. The handleMenuInput function checks if the input parameter is false, indicating that the menu is closing. If it is closing, the method proceeds to execute this.doSomethingYouLike().

Please note that this solution may not be compatible with the version of Vue mentioned in the original question, but I hope it provides some guidance. Enjoy!

user42488
  • 1,140
  • 14
  • 26