Skip to content

mini-router


源码仓库地址

核心原理

  • history模式,监听popstate事件,更改路由
  • hash模式,监听hashchange事件,更改路由
  • 在vue中,通过动态切换组件的形式更新页面