【发布时间】:2023-03-16 15:06:01
【问题描述】:
我在在线共享点的 SPFX webpart 中有一个下拉菜单。在那个下拉菜单中,onchange,我正在构建一个带有# 标签的 url。 前任。 https://sharepointonine/default.aspx#2349-234234-23434
我需要导航到这个新网址。我不确定如何完成事情。 我试过了:
window.location = url //Gives error that string is not assignable to Location
window.location.href= url//does not reload the page
window.open(url, "_self")//does not reload the page
window.location.assign(url);//does not reload the page
window.location.replace(url);//does not reload the page
有什么帮助吗?
【问题讨论】: