Fix default tab settings (fix #3817)

This commit is contained in:
the1812 2022-11-18 20:25:45 +08:00
parent 868ac40d47
commit c6ad3cd9bc
2 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<HomeRedesignBase> <HomeRedesignBase>
<div class="minimal-home"> <div class="minimal-home">
<TabControl class="minimal-home-tabs" :tabs="tabs" /> <TabControl class="minimal-home-tabs" :default-tab="defaultTab" :tabs="tabs" />
</div> </div>
</HomeRedesignBase> </HomeRedesignBase>
</template> </template>
@ -35,6 +35,7 @@ export default Vue.extend({
data() { data() {
return { return {
tabs, tabs,
defaultTab: minimalHomeOptions.defaultTab,
} }
}, },
mounted() { mounted() {

View File

@ -68,6 +68,11 @@ export default Vue.extend({
return true return true
}, },
}, },
defaultTab: {
type: String,
required: false,
default: '',
},
link: { link: {
type: String, type: String,
required: false, required: false,
@ -80,7 +85,8 @@ export default Vue.extend({
}, },
data() { data() {
return { return {
selectedTab: this.tabs[0] as TabMapping, selectedTab: (this.tabs.find((t: TabMapping) => t.name === this.defaultTab) ??
this.tabs[0]) as TabMapping,
} }
}, },
mounted() { mounted() {