簡體   English   中英

vue js Nuxt 重定向到外部 url

[英]vue js Nuxt redirect to external url

你好,我想重定向 url 示例https://mylink.com/some-page.html和我的獲取鏈接https://mylink.com/another-page.html

我正在使用 router.replace 但在第一個鏈接中添加最后一個鏈接如何解決此問題以將第一個鏈接替換為第二個

我正在使用window.location可以在 vue 路由器或 nuxt 中使用另一個解決方案嗎?

這個想法是一個params {'another-page'}但api 返回所有 url https://mylink.com/another-page.html而不僅僅是 params。

怎么做。

您可能應該獲取接收到的 URL 並將其最后一部分剪切為只有路徑。 然后你可以使用 Vue 路由器移動到 Nuxt 應用程序內的相應頁面。

你可以使用this.$router.push('/another-page'); 用於內部鏈接。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM