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

View File

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

View File

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