output: "export"
打包出来是这样。我不知道nginx应该怎么配置了。
try_files $uri /index.html;
nginx这样配置,点击路由可以跳转,刷新页面竟然到首页。
nginx 配置
location / {
# 将以.html结尾的请求添加Cache-Control头信息
if ($uri ~* \.(html)$) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
location ~ ^/([a-zA-Z0-9_-]+)/ {
try_files $uri /$1.html;
}
# 默认情况下,转发到index.html
try_files $uri /index.html;
}
正确的nginx配置文件