获取当前页面的URL
语法
import { getCurrentUrl } from 'warbler-js';
const result = getCurrentUrl()
参数
null
返回值
String : 当前页面的 URL
。
源码
const getCurrentUrl = () => window.location.href;
例子
import { getCurrentUrl } from 'warbler-js';
const result = getCurrentUrl()
console.log(result) //=>http://warblerjs.duwanyu.com