Skip to content

Commit 17b90fa

Browse files
committed
feat: 非开发环境下全局隐藏报错
1 parent 61d49ec commit 17b90fa

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

app/plugins/ErrorHandler.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable no-console */
2+
3+
export default defineNuxtPlugin((nuxtApp) => {
4+
if (import.meta.dev) {
5+
return;
6+
}
7+
nuxtApp.vueApp.config.errorHandler = () => {
8+
console.log('未知错误');
9+
};
10+
});

0 commit comments

Comments
 (0)