no message
Former-commit-id: b18d2e79b32a114de2d412de0b02c6890cd20448 [formerly 016a5a6df0157a2a92558e109e7a3e48ea903fb0] [formerly b18d2e79b32a114de2d412de0b02c6890cd20448 [formerly 016a5a6df0157a2a92558e109e7a3e48ea903fb0] [formerly b18d2e79b32a114de2d412de0b02c6890cd20448 [formerly 016a5a6df0157a2a92558e109e7a3e48ea903fb0] [formerly 016a5a6df0157a2a92558e109e7a3e48ea903fb0 [formerly a1b37ed05c57fad981c72c75f7f71a1b81c5829d [formerly 4832403e7da7a7101336ee08ba7a7d8f28aa3129]]]]] Former-commit-id: 71f90fbafda2b84f03eea9d18855bfcba703b25b Former-commit-id: 8e8399eb321fcbfa14e571ab9f0f86caddb1765e Former-commit-id: 5a5864ba7f2ea290b7c5bf0de213f9e3432164e2 [formerly e3f0050d3e299b84d7f483a638648c0c0ed3686c] Former-commit-id: c5409df62bce5f0d91240519f2280e0afbb1f8ce Former-commit-id: aad9ef2bd990278650be188d53ce5ee26699394c Former-commit-id: 5a17a9701ea1a0cd82e174dc184e98f4fac7019c Former-commit-id: 07bfa7139c6227d3f266ce0ed5ee101a2a7b2af3 Former-commit-id: a0b2ea513273e4222111acf0c576e8671f81f90b
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
export default {
|
||||
methods: {
|
||||
handleMenuSelect (index, indexPath) {
|
||||
console.group('handleMenuSelect')
|
||||
console.log('index: ', index)
|
||||
console.groupEnd()
|
||||
if (/^d2-menu-empty-\d+$/.test(index)) {
|
||||
this.$message('功能正在开发')
|
||||
} else {
|
||||
this.$router.push(index)
|
||||
this.$router.push({
|
||||
path: index
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
src/main.js
29
src/main.js
@@ -7,7 +7,10 @@ import i18n from './i18n'
|
||||
// vuex
|
||||
import store from '@/store/index.js'
|
||||
|
||||
// 路由
|
||||
import router from './router'
|
||||
// 框架内的路由
|
||||
import { frameInRoutes } from '@/router/routes'
|
||||
|
||||
import ElementUI from 'element-ui'
|
||||
import 'element-ui/lib/theme-chalk/index.css'
|
||||
@@ -79,5 +82,29 @@ new Vue({
|
||||
i18n,
|
||||
router,
|
||||
template: '<App/>',
|
||||
components: { App }
|
||||
components: { App },
|
||||
created () {
|
||||
// 处理路由 得到每一级的路由设置
|
||||
this.getAllTagFromRoutes()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 处理路由 得到每一级的路由设置
|
||||
*/
|
||||
getAllTagFromRoutes () {
|
||||
console.log('routes', frameInRoutes)
|
||||
const tags = []
|
||||
const push = function (routes) {
|
||||
routes.forEach(route => {
|
||||
if (route.children) {
|
||||
push(route.children)
|
||||
} else {
|
||||
tags.push(route)
|
||||
}
|
||||
})
|
||||
}
|
||||
push(frameInRoutes)
|
||||
console.log('tags', tags)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,11 +2,11 @@ import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
import util from '@/libs/util.js'
|
||||
|
||||
// 路由数据
|
||||
import routes from './routes'
|
||||
|
||||
import util from '@/libs/util.js'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
let router = new VueRouter({ routes })
|
||||
@@ -36,7 +36,6 @@ router.beforeEach((to, from, next) => {
|
||||
|
||||
// TODO: 路由跳转后自动滚动到顶部
|
||||
router.afterEach(to => {
|
||||
console.log('to', to)
|
||||
// 需要的信息
|
||||
const app = router.app
|
||||
const { name, params, query } = to
|
||||
@@ -48,7 +47,6 @@ router.afterEach(to => {
|
||||
console.log('query: ', query)
|
||||
console.groupEnd()
|
||||
// 多页控制 打开新的页面
|
||||
console.log('app', app)
|
||||
util.openNewPage(app, name, params, query)
|
||||
})
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
a7db0247e157a65ee28ba9fc302b042b5ee0c289
|
||||
bd6085cdedc8b795441980caba311c098d002f0d
|
||||
Reference in New Issue
Block a user