# 获取当前网址

获取当前页路由的地址

使用
import { currentURL } from 'util-snippets';

/**
 * 示例:currentURL(); // 'https://medium.com/@fatosmorina'
 */

currentURL();
代码
const currentURL = (): string => window.location.href;