Commit 0c253308 by liimin

优化

1 parent 449e3220
......@@ -10,10 +10,11 @@
<script>
import { currentId } from './mixins/index'
import { mapGetters } from 'vuex'
export default {
name: 'LeftSideMenuLv2',
mixins: [currentId],
inject: ['bus'],
inject: ['bus', 'isPop'],
created() {
this.bus.$on('menuOpenedsChanged', this.handleMenuOpenedsChanged)
},
......@@ -23,6 +24,9 @@ export default {
beforeDestroy() {
this.bus.$off('menuOpenedsChanged', this.handleMenuOpenedsChanged)
},
computed: {
...mapGetters(['menu'])
},
watch: {
current: {
handler(n) {
......@@ -43,6 +47,7 @@ export default {
this.cur.active = `${lv1}-${lv2}-${lv3}`
},
handleMenuOpenedsChanged({ menus }) {
if (this.menu.isCollapse && !this.isPop) return
const _ids = menus.map(({ id, children = [] }) => {
if (children.noHidden().length) {
return id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!