Files
vue-ts-example-2025/src/plugins/00.app-config.ts
严浩 290aed74f2
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
fix(App): 调整 Toast 组件 z-index 并优化国际化缺失提示
- 为 Toast 组件添加 style="z-index: 5000" 以确保其层级高于其他 UI 元素
- 在开发模式下,当菜单翻译缺失时,通过 ToastService 弹出警告提示
- 更新 app-config 插件中的 __DEV__ 注释,明确其来源于 vite.config.ts 的 define 配置
- 提高 PrimeVue 的 zIndex 配置值,避免与自定义组件层级冲突
2025-11-05 23:23:28 +08:00

15 lines
521 B
TypeScript

export function install({ app }: { app: import('vue').App<Element> }) {
app.config.globalProperties.__DEV__ =
__DEV__; /* vite.config.ts: define: { __DEV__: JSON.stringify(!isBuild) } */
app.config.errorHandler = (error, instance, info) => {
console.error('Global error:', error);
console.error('Component:', instance);
console.error('Error Info:', info);
// 这里你可以:
// 1. 发送错误到日志服务
// 2. 显示全局错误提示
// 3. 进行错误分析和处理
};
}