vue全家桶的使用<router-view>routerviewvueX嵌套路由子路由动态路由路由拦截路由守卫elementUiSPA
Posted web半晨
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue全家桶的使用<router-view>routerviewvueX嵌套路由子路由动态路由路由拦截路由守卫elementUiSPA相关的知识,希望对你有一定的参考价值。
目录
1、关键代码(router/index.js)文件
import Vue from 'vue';
import VueRouter from 'vue-router';
import ContainerPage from '@/view/containerPage/index';
import PageA from "@/view/pagea/index";
import PageB from "@/view/pageb/index";
import PageC from "@/view/pagec/index";
Vue.use(VueRouter);
const routes = [
path: '/',
redirect: '/containerPage'
,
path: '/containerPage',
name: "containerPage",
component: ContainerPage,
children: [
path: '/containerPage',
redirect: '/containerPage/pagea'
,
id: 1,
path: 'pagea',
name: 'pagea',
class: "el-icon-menu",
component: PageA,
title: "页面A"
,
id: 2,
path: 'pageb',
name: 'pageb',
class: "el-icon-document",
component: PageB,
title: "页面B"
,
id: 3,
path: 'pagec',
name: 'pagec',
class: "el-icon-setting",
component: PageC,
title: "页面C"
]
,
];
export default new VueRouter( routes );
2、完整代码
gitee(码云)develop分支vueFamilybucket文件夹
以上是关于vue全家桶的使用<router-view>routerviewvueX嵌套路由子路由动态路由路由拦截路由守卫elementUiSPA的主要内容,如果未能解决你的问题,请参考以下文章
SpringBoot+VueES6模块化SPA-Vue企业级开发和Vue全家桶