2019-11-01
描述
返回当前页面的链接。
提示
- 使用
window.location.href
获取当前链接
代码
const currentURL = () => window.location.href;
示例
事件中心的调用:
currentURL(); // 'https://hacpai.com/article/1572572694000?r=Vanessa'
2019-11-01
返回当前页面的链接。
window.location.href
获取当前链接const currentURL = () => window.location.href;
事件中心的调用:
currentURL(); // 'https://hacpai.com/article/1572572694000?r=Vanessa'