Commit 2db68526 by liimin

1

1 parent ef7a4e97
...@@ -22,11 +22,12 @@ export default { ...@@ -22,11 +22,12 @@ export default {
} }
}, },
watch: { watch: {
current: { // current: {
handler() { // handler() {
this.onLoad() // this.onLoad()
} // },
} // immediate: true
// }
}, },
mounted() { mounted() {
this.bus.$on('menu3Changed', this.onMenu3Changed) this.bus.$on('menu3Changed', this.onMenu3Changed)
...@@ -41,9 +42,14 @@ export default { ...@@ -41,9 +42,14 @@ export default {
}, },
setActive(activeId = '', nav4 = []) { setActive(activeId = '', nav4 = []) {
this.nav4 = nav4 this.nav4 = nav4
const sub = this.find(activeId) if (nav4.length) {
if (sub) { const sub = nav4.find(({ id }) => id == activeId)
this.$nextTick(() => (this.activeName = sub.path)) if (sub) {
this.$nextTick(() => {
this.activeName = sub.path
this.$router.push(sub.path)
})
}
} }
}, },
onMenu3Changed(menus = []) { onMenu3Changed(menus = []) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!