Commit cbb65622 by 匡雅琴

解决tab标签默认选中问题

1 parent 16fd7025
......@@ -131,11 +131,11 @@ export default {
})
if (status) {
this.$set(this.tabMenu, idx, menuSelect[0])
this.tabName = this.tabMenu[idx] ? this.tabMenu[idx].accounttypeId : ''
this.tabName = this.tabMenu[idx] ? this.tabMenu[idx].accounttypeId + '' : ''
} else {
this.$set(this.tabMenu, idx, '')
let accounttypeId = this.tabMenu.find(item => item)
this.tabName = accounttypeId ? accounttypeId.accounttypeId : ''
this.tabName = accounttypeId ? accounttypeId.accounttypeId + '' : ''
}
console.log(this.tabMenu)
this.tabMenuStatus = this.tabMenu.some(item => item)
......
......@@ -65,7 +65,7 @@ export default {
productId: 0,
products: [],
productsArr: [],
tabName: '2',
tabName: '',
productTab: '',
defaultProps: {
children: 'children',
......@@ -107,8 +107,6 @@ export default {
this.productTab = productId
},
findMenuFunTree(id, status) {
console.log(id, status)
// this.tabName = id + ''
let menu = util.deepClone(this.tabMenu)
let tabMenu = util.deepClone(this.tabMenu_r)
let menuSelect = tabMenu.filter(item => item.accounttypeId == id)
......@@ -133,11 +131,11 @@ export default {
})
if (status) {
this.$set(this.tabMenu, idx, menuSelect[0])
this.tabName = this.tabMenu[idx] ? this.tabMenu[idx].accounttypeId : ''
this.tabName = this.tabMenu[idx] ? this.tabMenu[idx].accounttypeId + '' : ''
} else {
this.$set(this.tabMenu, idx, '')
let accounttypeId = this.tabMenu.find(item => item)
this.tabName = accounttypeId ? accounttypeId.accounttypeId : ''
this.tabName = accounttypeId ? accounttypeId.accounttypeId + '' : ''
}
console.log(this.tabMenu)
this.tabMenuStatus = this.tabMenu.some(item => item)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!