如何在参数更改时刷新当前路由?

How do I refresh the current route when arguments change?

我正在使用 auto_route 和一些参数作为 url 参数。如果我推送与当前路径相同的路径,但使用不同的参数,则显示的小部件不会更新。

为什么不呢?我可以强制它更新还是有 auto_route 的设置来检测这些更改?

默认情况下 auto_route 将路由名称视为其键。您可以使用 *Route class:

中的 usePathAsKey 参数更改该行为
Property Default value Definition
usePathAsKey false if true path is used as page key instead of name

source