简单Vue路由
0 1

Vue Router 的 hash模式和 history 模式 有哪些关键差异?

【概念释义】

hash:URL #/path,hash 变不请求服务器,兼容 IE 老环境。history/path 真实路径,需 服务器回 index.html;SEO 与 URL 美观更好。二者组件代码一致,差在 history 实现。

【基础使用】

javascript
"qb-hl-comment">// hash: https://a.com/#/user
"qb-hl-comment">// history: https://a.com/user
new VueRouter({ mode: "history", routes });

【版本差异】

登录查看完整 656

回答讨论

暂无讨论,登录后可抢先发言

本题库更多题目(50)