1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| import Vue from 'vue' import VueRouter from 'vue-router' import Parent from './components/parent.vue' import Hello from './components/hello.vue'
import Hello1 from './components/heChild/hello1.vue' import Hello2 from './components/heChild/hello2.vue' import Hello3 from './components/heChild/hello3.vue'
import Wa from './components/wa.vue'
Vue.use(VueRouter)
export default new VueRouter({ linkActiveClass:'active',
) routes: [ { path: "/", name:'parent', component:Parent , }, { path: "/hello", name:'hello', component:Hello , redirect:'/hello/heChild/hello1', children:[{ path:'/hello/heChild/hello1', name:'hello1', component:Hello1, }, { path:'/hello/heChild/hello2', name:'hello2', component:Hello2, }, { path:'/hello/heChild/hello3', name:'hello3', component:Hello3, }] }, { path: "/wa/:count/:name", name:'wa', component:Wa, },
] })
|