feat: 添加全局错误处理逻辑,优化 PrimeVue 插件导入和路由设置
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 1m37s
/ playwright (push) Successful in 2m1s
/ depcheck (push) Successful in 1m45s

This commit is contained in:
严浩
2024-12-17 09:21:08 +08:00
parent 1dc0230a3e
commit a5c1cf38f6
3 changed files with 25 additions and 13 deletions

View File

@ -20,6 +20,16 @@ async function init() {
.use(createHead())
.use(createPinia().use(piniaPluginPersistedstate));
app.config.errorHandler = (error, instance, info) => {
console.error('Global error:', error);
console.error('Component:', instance);
console.error('Error Info:', info);
// 这里你可以:
// 1. 发送错误到日志服务
// 2. 显示全局错误提示
// 3. 进行错误分析和处理
};
setupVueI18n(app);
setupPrimeVue(app);
setupRouter(app);