簡體   English   中英

vue-router:按名稱和參數導航到嵌套狀態/路由

[英]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
      }
    ]
  }
];

我怎樣才能瀏覽到CustomerDetailsid使用的參數組$router.push

這達到了目的:

this.$router.push({ name: `CustomerDetails`, params: {id} });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM