|
@@ -43,10 +43,12 @@ export default {
|
|
...mapGetters('tabbar', ['activeTabKey', 'tabbars'])
|
|
...mapGetters('tabbar', ['activeTabKey', 'tabbars'])
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...mapMutations('tabbar', ['setSwitchTab']),
|
|
...mapActions('tabbar', ['doSwitchTab']),
|
|
...mapActions('tabbar', ['doSwitchTab']),
|
|
checkActiveTabbar () {
|
|
checkActiveTabbar () {
|
|
- const activeKey = this.getComputedActiveKey(this.activeTabKey || this.tabbars[0].key)
|
|
|
|
- this.doSwitchTab(activeKey)
|
|
|
|
|
|
+ const defaultKey = this.activeTabKey || (this.tabbars[0] ? this.tabbars[0].key : '')
|
|
|
|
+ const activeKey = this.getComputedActiveKey(defaultKey)
|
|
|
|
+ this.setSwitchTab(activeKey)
|
|
},
|
|
},
|
|
getComputedActiveKey (defaultActive = '') {
|
|
getComputedActiveKey (defaultActive = '') {
|
|
let active = defaultActive
|
|
let active = defaultActive
|