0
look this version with vuex
seletedTab is a getters, use it anywhere in the app.
Vue Js code:
<script>
import TabParentComponent from
'../../components/layout/tabParentComponent.vue'
import TabChildComponent from
'../../components/layout/tabChildComponent.vue'
import { mapGetters, mapActions } from 'vuex'
export default {
components: {
'tab': TabChildComponent,
'tabs': TabParentComponent
},
computed: {...mapGetters([
'selectedTab'
])
},
methods: {
...mapActions([
'GoTab'
])
}
}
</script>
Do not forget that the structure of the application with vuex will be slightly different! See Application Structure
- [Vuejs]-How to add Tailwind CSS with Quasar?
- [Vuejs]-Vue : v-for store unmatched items to different container
Source:stackexchange.com