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

View File

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