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!