路由

81 阅读1分钟

hash路由

  • 兼容多版本,在页面展示路径
a标签的href ='#aaa' 就是hash变化
location.hashchange 可以实时监控hash变化

browers路由

  • 根据h5 history路由来的

api

概念: 浏览器有一个历史记录池,前进后退都是基于记录前进后退

window.history.back() 后跳页面 window.history.forward() 前进一个页面