vueRouter 子路由嵌套

router.js

 1 import Vue from 'vue'
 2 import Router from 'vue-router'
 3 import contractPage from './views/contractPage.vue'
 4 import finish from './views/finish.vue'
 5 import unfinish from './views/unfinish.vue'
 6 import Pdf from './views/pdf.vue';
 7 Vue.use(Router)
 8 
 9 export default new Router({
10     routes: [
11         {
12             path: '/',
13             name: 'contractPage',
14             component: contractPage,
15             children:[
16                 {path:'finish',name: 'finish',component:finish},
17                 {path:'unfinish',name: 'unfinish',component:unfinish}
18             ],
19             redirect:'/unfinish'
20         },
21         {
22             path: "/pdf",
23             name: 'pdf',
24             component: Pdf
25         }
26     ]
27 })

页面

猜你喜欢

转载自www.cnblogs.com/zhaozhenzhen/p/10751132.html