前端面试

92 阅读1分钟

hash路由和history路由实现原理说一下 location.hash的值实际就是URL中的#后面的东西。 history实际采用了HTML5中提供的API来实现,主要有history.pushState()和history.replaceState()