工作模式
约 133 字小于 1 分钟
2025-08-08
history
模式
优点:URL
更加美观,不带有 #
,更接近传统的网站 URL
,有利于 SEO
缺点:后期项目上线,需要服务端配合处理路径问题,否则刷新会有404
错误。
const router = createRouter({
history: createWebHistory(), //history模式
/******/
});
hash
模式
优点:兼容性更好,因为不需要服务器端处理路径。
缺点:URL
带有 #
不太美观,且在 SEO
优化方面相对较差。
const router = createRouter({
history: createWebHashHistory(), //hash模式
/******/
});
更新日志
2025/8/24 08:17
查看所有更新日志
e7112
-1于