Svelte-Navigator的默认路线?

发布于 2025-02-10 17:25:44 字数 129 浏览 0 评论 0原文

我正在使用Svelte -navigator来处理我的Svelte应用程序中的路由,并且我有一个问题,即访问我未定义的路由时,它仍然会加载标头和侧栏等(路由外) - 是否有一个设置默认路由的方法,以便在访问未定义的路由时,它可以重定向到主页等?

I'm using svelte-navigator to handle routing in my Svelte application, and I have the issue that when accessing a route that I have not defined, it still loads the header and sidebar etc (which are outside the routes) - Is there a way to set a default route, so that when accessing an undefined route, it can redirect to the home page etc?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

假装爱人 2025-02-17 17:25:44

从文档

<!--
  Routes without a path are default routes.
  They will match if no other Route could be matched
-->
<Route component="{Home}"></Route>

From the documentation

<!--
  Routes without a path are default routes.
  They will match if no other Route could be matched
-->
<Route component="{Home}"></Route>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文