Skip to content

Vue Router Q&A

编程题

一、模拟 VueRouter 的 hash 模式的实现,实现思路和 History 模式类似,把 URL 中的 # 后面的内容作为路由的地址,可以通过 hashchange 事件监听路由地址的变化。

见code/vueRouter-hash文件夹

MIT Licensed