gpt4 book ai didi

vue.js - vue-router:按名称和参数导航到嵌套状态/路由

转载 作者:行者123 更新时间:2023-12-03 06:44:20 25 4
gpt4 key购买 nike

如何使用 $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} });

关于vue.js - vue-router:按名称和参数导航到嵌套状态/路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52977183/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com