mirror of
https://github.com/romancm/gamebrary
synced 2024-11-28 06:00:22 +00:00
Go to setting tab based on where you are in the app
This commit is contained in:
parent
ba15840828
commit
1a2b41407b
1 changed files with 12 additions and 2 deletions
|
@ -9,7 +9,7 @@
|
|||
@click="openSettings(section)"
|
||||
>
|
||||
<i :class="section.icon" />
|
||||
{{ $t(`settings.${section.name}`) }}
|
||||
{{ getTabName(section.name) }}
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
|
@ -133,10 +133,20 @@ export default {
|
|||
this.localSettings = JSON.parse(JSON.stringify(this.settings));
|
||||
this.language = this.localSettings.language || 'en';
|
||||
|
||||
this.openSettings(this.settingsSections[0]);
|
||||
switch (this.$route.name) {
|
||||
case 'game-board': this.openSettings({ name: 'gameBoard', component: 'GameBoardSettings' }); break;
|
||||
case 'platforms': this.openSettings({ name: 'platforms', component: 'PlatformsSettings' }); break;
|
||||
default: this.openSettings(this.settingsSections[0]);
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getTabName(sectionName) {
|
||||
return sectionName === 'gameBoard' && this.platform && this.$route.name === 'game-board'
|
||||
? this.platform.name
|
||||
: this.$t(`settings.${sectionName}`);
|
||||
},
|
||||
|
||||
openSettings({ component, name }) {
|
||||
this.activeComponent = component;
|
||||
this.activeSection = name;
|
||||
|
|
Loading…
Reference in a new issue