[英]vue-router: navigate to nested state/route by name and params
如何使用$router.push
導航到子狀態?
我的路線:
const routes = [
{
path: "/customers", name: 'Customers',
components: {content: CustomersMain},
props: {header: true, content: false},
children: [
{
path: '',
component: CustomerDetailsEmpty
},
{
path: ':id',
name: 'CustomerDetails',
component: CustomerDetails
}
]
}
];
我怎樣才能瀏覽到CustomerDetails
與id
使用的參數組$router.push
?
這達到了目的:
this.$router.push({ name: `CustomerDetails`, params: {id} });
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.