Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Svelte 和 Routify 构建一个餐厅评论网站,我有一个路径“./reviews”,显示当前用户自己的评论,以及不同类别餐厅的评论路径,即“./reviews/mexican”或“ ./reviews/asian”,当我点击墨西哥的标签时,“./reviews”和“./reviews/mexican”似乎都被打开为isActive,如何在Routify中设置确切的路径?
谢谢!
这应该工作
$isActive('/path/to/component', { /* params */ }, { strict: true})
将 strict 设置为 false,路径将默认为/path/to/component/index,因此不会匹配任何后代组件。
/path/to/component/index
https://routify.dev/docs/helpers#is-active