Often when you close a dialog you want do to some cleanup. The docs suggest you do:
watch: {
dialog(val) {
val || this.close();
},
},
But it seems emitting a close
event would be simpler.
Emit a close
event, so you can do
<v-dialog v-model="dialog" @close="close">...</v-dialog>
Listen to @input
event
<v-dialog @input="v => v || doSomething()">
On a side note, as per Vue docs, we want to pretty avoid watch
and use computed
AMAP.
Most helpful comment
Listen to
@input
event<v-dialog @input="v => v || doSomething()">