0

I have a crud table also a global component registered, inside this Table I have a Toolbar for crud operation.

Lets say I have a v-tabs component which contain "tab 1 " and “tab 2”
in “tab 1” I have this crud table
in "tab 2 " I have the details to this table which contain Inputs like v-text-field or v-combobox…

My question is: is it possible to show the Tollbar from the crud table in “tab 1” in “tab 2”?
→ I want to show the Toolbar in both Tabs
if yes how?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Marwen_mxm
  • 21
  • 1
  • 6
  • Please provide some code to us to see what you've made. Otherwise it's really difficult to help you out! – B0BBY Nov 08 '21 at 13:12

1 Answers1

0

You can't have the same toolbar in two tab items because you will create a new instance of the toolbar every place you add the component.

One solution is to keep the toolbar data (like input queries etc.) in the parent element. Use events to modify the data on change and pass it back to the toolbar as prop. If you pass the same data to the two toolbars, they will function as if it's the same toolbar.

Another solution is to take the toolbar outside on the tab items. You can try to put it between the v-tabs and v-tab-items using v-show to hide when other tabs are selected.

Muge
  • 335
  • 1
  • 9