import{ history }from'umi';// history 栈的实体个数console.log(history.length);// 当前 history 跳转的action, 有push/replace/pop 三种类型console.log(history.action)// location 对象,包含 pathname/search/hashconsole.log(history.location.pathname)console.log(history.location.search)console.log(history.location.hash)
history (API)可用于获取当前路由信息import { history } from 'umi';// history 栈的实体个数console.log(history.length);// 当前 history 跳转的action, 有push/replace/pop 三种类型console.log(history.action)// location 对象,包含 pathname/search/hashconsole.log(history.location.pathn