The best I could find (after much trial/error) to ensure onDialogOK
does bubble back as expected is to get rid of the auto-close
option in q-menu
and handle closing of the pop up menu manually instead. Changes as follows:
pages/IndexPage.vue: (define isMenuOpen
and pass the state as follows: <LocalMenu v-model="isMenuOpen">
):
import { ref } from 'vue'
const isMenuOpen = ref(false)
function onDialogOK () {
isMenuOpen.value = false
console.log('OK Event received in parent!')
}
components/LocalMenu.vue: (pass the model in as follows: <q-menu self="top left" v-model="model">
and add the following:
<script setup>
const model = defineModel()
</script>
This does the job but has the disadvantage of "leaking" the menu state into the parent. It really feels like a workaround to smth that should work out of the box in Quasar?