refactor: change property rootSubmenuKeys to auto computed

master
chenghx 6 years ago
parent 8a0c4b9a3c
commit 1488821833
  1. 10
      src/components/menu/menu.js

@ -51,12 +51,20 @@ export default {
},
data () {
return {
rootSubmenuKeys: ['/dashboard', '/form', '/list', '/detail', '/exception', '/result'],
openKeys: [],
selectedKeys: [],
cachedOpenKeys: []
}
},
computed: {
rootSubmenuKeys: (vm) => {
let keys = []
vm.menuData.forEach(item => {
keys.push(item.path)
})
return keys
}
},
created () {
this.updateMenu()
},

Loading…
Cancel
Save