diff --git a/src/pages/admin.vue b/src/pages/admin.vue index dfb651b..c5d74a3 100644 --- a/src/pages/admin.vue +++ b/src/pages/admin.vue @@ -59,8 +59,8 @@ export default { // params console.log(1) // this.$router.push({path: '/params/123' }) - this.$router.push({name:"params",params:{id:123,name:111,aaa:111}}) - // this.$router.push("/") + // this.$router.push({name:"params",params:{id:123,name:111,aaa:111}}) + this.$router.push("/sitteng/user") }, replace(){ // 不能回退 会替换当前路由 (当前路由被删除 用跳转之后的代替) diff --git a/src/pages/sitteng.vue b/src/pages/sitteng.vue new file mode 100644 index 0000000..7c4c1b7 --- /dev/null +++ b/src/pages/sitteng.vue @@ -0,0 +1,44 @@ + + + + 到index + 到user + 到admin + + + + + + + + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index b2cc9a2..97b2185 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -14,6 +14,31 @@ const routes = [ next() }, component: admin }, + { + path:"/sitteng", + component: () => import("../pages/sitteng.vue"), + children:[ + { + path:"index", + component: () => import("../views/index.vue"), + meta:123, beforeEnter: (to, from, next) => { + // ... + console.log("路由独享") + next() + } + + }, + { + path: "user", + component: () => import("../views/user.vue") + }, + { + path:"admin", + component: () => import("../pages/admin.vue") + } + + ] + }, { path: "/params",meta:"admin", name: "params", component: () => import("../pages/params.vue") } // ()=>import('') 按需加载 路由异步加载 ] // path