SvelteKit:禁用<a>来自同一主机的某些链接的内部链接路由



我在Svelte组件中有一个链接。此链接的目的地由备用代理服务器处理,因此链接目的地不是Svelte应用程序的一部分,即使它与Svelte应用程序共享相同的URL路径。

如果我点击链接,Svelte将尝试用其内部路由器解析该链接。如何在Svelte中强制网页浏览器加载链接,内部路由器跳过该链接?

我的链接代码是:
<!-- /docs/ is served from the reverse proxy by the web server and not part of Svelte -->
<a href="https://tradingstrategy.ai/docs/index.html">Documentation</a>

您可以告诉SvelteKit跳过处理链接,并使用正常的浏览器导航与rel="external"属性。

这个属性记录在这里:https://kit.svelte.dev/docs/link-options#data-sveltekit-reload

<a rel="external" href="https://tradingstrategy.ai/docs/index.html">Documentation</a>

最新更新