VUE3 + Vite 编译部署后不报错,但显示空白页面

1、在 vite.config.js 中添加(ts版本则为 vite.config.ts)

base: './'

 

 2、将路由模式改为 hash 模式

history: createWebHashHistory()

 

3、注意检查路由文件需要由函数导入

(我的是未使用箭头函数导入,本地运行正常,但部署后无法正确加载路由,也不报错,找死人。。。)

 

posted @ 2025-02-22 04:13  悬剑丶  阅读(821)  评论(0)    收藏  举报