mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
refactor: change property rootSubmenuKeys to auto computed
This commit is contained in:
parent
8a0c4b9a3c
commit
1488821833
@ -51,12 +51,20 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
rootSubmenuKeys: ['/dashboard', '/form', '/list', '/detail', '/exception', '/result'],
|
|
||||||
openKeys: [],
|
openKeys: [],
|
||||||
selectedKeys: [],
|
selectedKeys: [],
|
||||||
cachedOpenKeys: []
|
cachedOpenKeys: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
rootSubmenuKeys: (vm) => {
|
||||||
|
let keys = []
|
||||||
|
vm.menuData.forEach(item => {
|
||||||
|
keys.push(item.path)
|
||||||
|
})
|
||||||
|
return keys
|
||||||
|
}
|
||||||
|
},
|
||||||
created () {
|
created () {
|
||||||
this.updateMenu()
|
this.updateMenu()
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user