router.js跳轉設置參數
{
path: '/profile/:fcId',
component: Profile
}
跳轉到頁面獲取參數
this.$route.params.fcId;
通過url後攜帶參數設置
第二種設置方式
this.$router.push({path: '/info?name=' + name});
獲取參數
this.$route.query.name
通過json數據傳遞
設置方式
this.$router.push({path: '/info', query:{age: 24}});
獲取方式
this.$route.query.age;