路由传参

name 传参

router/index.js

export default [
{
path: '/',
name:'Hello',
component: Hello
}

]

App.vue

{{ $route.name }}

子路由传参

App.vue

 <router-link :to="{path:'/Hi', name:'Hi1', params:{username:'zhouyx', id:'888'}}">Hi頁面一</router-link>

H1.vue 子页面

<h1>{{msg}} {{$route.params.username}} {{$route.params.id}}</h1>

 

posted @ 2017-08-28 12:01  简单就好zyx  阅读(146)  评论(0编辑  收藏  举报