feat: 添加 vite-plugin-vue-layouts 插件并更新 vite 版本至 6.0.5

This commit is contained in:
严浩
2024-12-25 00:06:46 +08:00
parent 400de0f222
commit bfbeb326bc
14 changed files with 122 additions and 64 deletions

14
src/plugins/_.ts Normal file
View File

@ -0,0 +1,14 @@
import { createHead } from '@unhead/vue';
export function install({ app }: { app: import('vue').App<Element> }) {
app.use(createHead());
app.config.errorHandler = (error, instance, info) => {
console.error('Global error:', error);
console.error('Component:', instance);
console.error('Error Info:', info);
// 这里你可以:
// 1. 发送错误到日志服务
// 2. 显示全局错误提示
// 3. 进行错误分析和处理
};
}