[Vuejs]-Emit event vuejs 3 and quasar

1👍

For the second solution, you can use "@update:model-value" event on q-tab for detect current tab changing.

0👍

Ok I have solved this by adding the click event on:

    <q-route-tab
      v-for="(tab, index) in tabs"
      :key="index"
      :to="tab.path"
      :name="tab.name"
      :label="$t(tab.label)"
      :ripple="false"
      exact
      @click="onTabClick(tab)"
    />

and then emit the event in a method:

methods: {
    onTabClick (tab) {
      console.log("this is now called", tab.name)
      this.$emit('onTabChange', tab.name)
    }
  }

Leave a comment