[Vuejs]-Passing events between Vue parent and child

0👍

The parent in this case is the TableTabs component. If the parent needs to listen to events emitted by a child component then it needs to add the event listener to the child component, which is the OrdersTable component in this case. So instead of this ..

<table-tabs
  v-on:new-tab="newTab"
  v-on:close-tab="closeTab"
  ref="tableTabs"
  name="table-tabs"
></table-tabs>

You should do this (inside the TableTabs component) ..

<orders-table
  name="orders-table"
  v-on:new-tab="newTab"
></orders-table>

Leave a comment