vue的一些知识(4)

Vue的路由实现:hash模式 和 history模式

hash模式:在浏览器中符号“#”,#以及#后面的字符称之为hash,用 window.location.hash 读取。特点:hash虽然在URL中,但不被包括在HTTP请求中;用来指导浏览器动作,对服务端安全无用,hash不会重加载页面。

history模式: pushState()replaceState()可以对浏览器历史记录栈进行修改,以及popState事件的监听到状态变更。

发布了19 篇原创文章 · 获赞 19 · 访问量 398

猜你喜欢

转载自blog.csdn.net/qq_41108972/article/details/104390589