我正在使用Ionic的离子路由器,我想替换整个路径。 我的路径:

问题描述 投票:0回答:0

但是我留下了:

http://localhost:3000/app/https://app.hubspot.com/oauth/

如何替换整个URL,以便在使用此时会得到一些类似的东西:

window.location.href = URL;

我只得到:

https://app.hubspot.com/oauth/

我使用的代码:

import { useIonRouter } from '@ionic/vue'; const ionRouter = useIonRouter(); ionRouter.replace(URL);

我尝试替换,并且。
    

您可以尝试以下代码重定向到其他链接
    // take variable and assign variable
    let url = "https://app.hubspot.com/oauth/"
    window.location.href = url

    // direct assign a value
    window.location.href = "https://app.hubspot.com/oauth/"

如果不适合您,请告诉我。
	

vue.js ionic-framework
© www.soinside.com 2019 - 2024. All rights reserved.