Fix: Tabs and tab headers no longer lose sync when changing characters
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
class="fill-height"
|
||||
>
|
||||
<v-tabs-items
|
||||
:value="$store.state.characterSheetTabs[$route.params.id]"
|
||||
:value="$store.getters.tabById($route.params.id)"
|
||||
@change="e => $store.commit(
|
||||
'setTabForCharacterSheet',
|
||||
{id: $route.params.id, tab: e}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
centered
|
||||
grow
|
||||
max="100px"
|
||||
:value="$store.state.characterSheetTabs[$route.params.id]"
|
||||
:value="$store.getters.tabById($route.params.id)"
|
||||
@change="e => $store.commit(
|
||||
'setTabForCharacterSheet',
|
||||
{id: $route.params.id, tab: e}
|
||||
|
||||
@@ -17,6 +17,16 @@ const store = new Vuex.Store({
|
||||
characterSheetTabs: {},
|
||||
showBuildDialog: false,
|
||||
},
|
||||
getters: {
|
||||
// ...
|
||||
tabById: (state) => (id) => {
|
||||
if (id in state.characterSheetTabs){
|
||||
return state.characterSheetTabs[id];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
toggleDrawer (state) {
|
||||
state.drawer = !state.drawer;
|
||||
|
||||
Reference in New Issue
Block a user