Vue2.0的群组路由

好久没发表啥感慨了,今天记录下Vue2.0的群组路由的内容.

路由配置代码:

routes: [
    {
      path: '/',
      name: 'Hello',
    //注意是's' components:{
    //默认显示页面 default:Home, a:Taba, b:Tabb }, }, { path: '/tab', name: 'Tab', components:{ default:Fir, a:Taba, b:Tabb }, }, ]

  APP.vue配置:

<template>
  <div id="app">
  <ul>
    <router-link :to="{name:'Tab',params:{id:'五一'}}" >路由一</router-link>
    <router-link :to="{name:'Hello',params:{id:'十一'}}">路由二</router-link>
  </ul>
  <router-view></router-view>
  <router-view name="a" class="a"></router-view>
  <router-view name="b" class="b"></router-view>
  </div>
</template>

  

 

posted @ 2017-04-28 19:34  webarn  阅读(245)  评论(0编辑  收藏  举报