Vuetify: [Feature Request] v-menu expose close event

Created on 6 May 2019  路  5Comments  路  Source: vuetifyjs/vuetify

Problem to solve

Want to call method on v-menu close.

Proposed solution

Expose close event for v-menu.

Example usage

Code pen

Want to save multiple selected months on v-menu close when v-menu is closed by clicking outside of v-menu instead of requiring user to click OK. Tried adding @click:month="$refs.menu.save(date)" to v-date-picker, which makes v-menu close on month selection. Would like to add @close="$refs.menu.save(date)" to v-menu to accomplish this.

If there is an existing workaround, please let me know. Thank you!

invalid

Most helpful comment

I started using Vuetify this week and I am trying v-menu component. I found there is a way to monitor the open/close event. just use v-model:

<v-menu offset-y v-model="menuOpened">
      ....
</v-menu>

I found this by looking at Vue's event's section in dev tool in chrome.
return-value is also an option.
2020-02-28 10_48_42-
2020-02-28 10_48_55-Sniip

All 5 comments

@input

When I add @input="$refs.menu.save(date)" to v-menu the menu won't open. When I add @input="$refs.menu.save(date)" to v-date-picker the menu closes on month selection, as it did with @click:month="$refs.menu.save(date)". How should I be using it?

The return-value prop could be an option.

I started using Vuetify this week and I am trying v-menu component. I found there is a way to monitor the open/close event. just use v-model:

<v-menu offset-y v-model="menuOpened">
      ....
</v-menu>

I found this by looking at Vue's event's section in dev tool in chrome.
return-value is also an option.
2020-02-28 10_48_42-
2020-02-28 10_48_55-Sniip

I also looked at the return-value prop for this but as @zeroarst mentioned, using v-model works perfectly.

Was this page helpful?
0 / 5 - 0 ratings