79604941

Date: 2025-05-03 17:14:23
Score: 0.5
Natty:
Report link

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?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: sxc731