Made tab swiping sync with the tab list

This commit is contained in:
Thaum Rystra
2020-05-25 17:07:38 +02:00
parent 3ec0f9500c
commit e9c643699c
3 changed files with 23 additions and 3 deletions

View File

@@ -35,7 +35,7 @@
class="fill-height" class="fill-height"
> >
<v-tabs-items <v-tabs-items
v-model="tabs" v-model="activeTab"
> >
<v-tab-item> <v-tab-item>
<stats-tab :creature-id="creatureId" /> <stats-tab :creature-id="creatureId" />
@@ -103,6 +103,16 @@
'creature.name'(value){ 'creature.name'(value){
this.$store.commit('setPageTitle', value || 'Character Sheet'); this.$store.commit('setPageTitle', value || 'Character Sheet');
}, },
},
computed: {
activeTab: {
get(){
return this.tabs;
},
set(newTab){
this.$emit('update:tabs', newTab);
},
},
}, },
meteor: { meteor: {
$subscribe: { $subscribe: {

View File

@@ -67,7 +67,7 @@
<v-fade-transition <v-fade-transition
mode="out-in" mode="out-in"
> >
<router-view :tabs="tabs" /> <router-view :tabs.sync="tabs" />
</v-fade-transition> </v-fade-transition>
</v-content> </v-content>

View File

@@ -2,7 +2,7 @@
<character-sheet <character-sheet
show-menu-button show-menu-button
:creature-id="$route.params.id" :creature-id="$route.params.id"
:tabs="tabs" :tabs.sync="activeTab"
/> />
</template> </template>
@@ -18,5 +18,15 @@ export default {
required: true, required: true,
}, },
}, },
computed: {
activeTab: {
get(){
return this.tabs;
},
set(newTab){
this.$emit('update:tabs', newTab);
},
},
},
} }
</script> </script>