-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
What problem does this feature solve?
I want to create a breadcrumb use the route.matched, but when I has the paramas in the router path, it doesn't work because the route.matched object only return the path but not fullpath.
example:
{
path: '/course',
name: 'Course',
component: Layout,
children: [{
path: ':cousrId/edit',
name: 'CourseEdit',
component: Course,
children: [{
path: 'lesson',
name: 'CourseLesson',
component: CourseLesson
}]
}]
}
I want to create a breadcrumb like
<a href="/course">course</a> > <a href="/course/2/edit">course edit</a> > <a href="">course edit lesson</a>
when I click the course edit
link, I can get the params courseId === 2
, but I only get the path /course/:courseId/edit
in the router.matched[1], the params doed not resolved, I could not got the real courseId
in the route.mathed object.
(我想使用route.matched 创建一个面包屑,但当我的路径中参数例如courseId 时,route.matched 返回的path 是未解析参数的 /course/:courseId/edit
。或许是我思路错了?请指教)
What does the proposed API look like?
resolved the params in each object at route.matched object base on the current url
[{
path: '/course/:courseId/edit,
fullpath: '/course/2/edit
}]
Tofandel
Metadata
Metadata
Assignees
Labels
No labels