feat(projects): add app error handler. close #587

This commit is contained in:
Soybean 2024-09-07 11:16:58 +08:00
parent 27b5222cfb
commit be8556cd2b

View File

@ -1,7 +1,15 @@
import { h } from 'vue';
import type { App } from 'vue';
import { NButton } from 'naive-ui';
import { $t } from '@/locales';
export function setupAppErrorHandle(app: App) {
app.config.errorHandler = (err, vm, info) => {
// eslint-disable-next-line no-console
console.error(err, vm, info);
};
}
export function setupAppVersionNotification() {
const canAutoUpdateApp = import.meta.env.VITE_AUTOMATICALLY_DETECT_UPDATE === 'Y';