中等Vue
0 1

Vue项目部署到服务器后,报404错误的原因是什么?

【概念释义】

Vue 部署后 404 主因:① history 路由未 fallback 到 index.html② publicPath/base 错误导致 JS/CSS 404 表现为白屏③ 接口 404 与静态混淆④ 子路径部署未配 nginx alias⑤ 路由未配 catch-all 业务 404。

【基础使用】

nginx
location / {
  try_files $uri $uri/ /index.html;
}
javascript
{ path: "/:pathMatch(.

登录查看完整 756

回答讨论

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

本题库更多题目(50)