顶栏菜单和侧边栏菜单数据提取到 vuex
Former-commit-id: 6414875fd24cb35bccc742e5a3e514eb38d0ccf0 [formerly e6a168bccde74a52be0c830c2801c3b68e142a02] [formerly 6414875fd24cb35bccc742e5a3e514eb38d0ccf0 [formerly e6a168bccde74a52be0c830c2801c3b68e142a02] [formerly 6414875fd24cb35bccc742e5a3e514eb38d0ccf0 [formerly e6a168bccde74a52be0c830c2801c3b68e142a02] [formerly e6a168bccde74a52be0c830c2801c3b68e142a02 [formerly 3c4b8f0831e08f17fb7d2d5925d1afac95a09ba9 [formerly 2147cfbd14ff74f1a7a370bd2a72421ef1efa062]]]]] Former-commit-id: 9ea5625e0ed3d637f244b1713e3f9a756083759d Former-commit-id: dd1b1385527e9a1bf0cef74820c7610fbbbd549a Former-commit-id: f003427229e0fbde1fc334fcf49488de2518e587 [formerly f16a7e264842bd11f1f68707ec802948f69c45ea] Former-commit-id: a569f31c6a01744eefb1cb0a660b419591a0c2b9 Former-commit-id: 1c5137d112590a66cb3c6383d26c9cd279a2b705 Former-commit-id: fb99d584dc8ebfe3553f5d77402ae614a2056ee5 Former-commit-id: 26093b1997b824a3db9f27b392ca912e622e3397 Former-commit-id: 4d82cce9bd2dda1e6de9407492d4e9c4c27e5da7
This commit is contained in:
10
src/main.js
10
src/main.js
@@ -14,6 +14,7 @@ import i18n from './i18n'
|
||||
import util from '@/libs/util'
|
||||
import store from '@/store/index'
|
||||
import { frameInRoutes } from '@/router/routes'
|
||||
import { menusAside, menusHeader } from '@/menu'
|
||||
import '@/assets/library/font-awesome-4.7.0/css/font-awesome.min.css'
|
||||
import '@/assets/library/highlight/styles/atom-one-light.css'
|
||||
import '@/assets/svg-icons'
|
||||
@@ -46,6 +47,8 @@ new Vue({
|
||||
created () {
|
||||
// 处理路由 得到每一级的路由设置
|
||||
this.getAllTagFromRoutes()
|
||||
// 设置顶栏菜单
|
||||
this.$store.commit('d2adminMenusHeaderSet', menusHeader)
|
||||
},
|
||||
mounted () {
|
||||
util.showInfo()
|
||||
@@ -60,6 +63,13 @@ new Vue({
|
||||
// 初始化全屏监听
|
||||
this.fullscreenListenerInit()
|
||||
},
|
||||
watch: {
|
||||
// 监听路由 控制侧边栏显示
|
||||
'$route.matched' (val) {
|
||||
const _side = menusAside.filter(menu => menu.path === val[0].path)
|
||||
this.$store.commit('d2adminMenusAsideSet', _side.length > 0 ? _side[0].children : [])
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 初始化全屏监听
|
||||
|
||||
Reference in New Issue
Block a user