import { createApp } from "vue"; import "./style.css"; import App from "./App.vue"; import ElementPlus from "element-plus"; import "element-plus/dist/index.css"; import "xgplayer/dist/index.min.css"; // 引入西瓜视频样式 import router from "@/router/index.js"; import pinia from "./store"; import VueUeditorWrap from "vue-ueditor-wrap"; import ZhLocale from "element-plus/es/locale/lang/zh-cn"; // 中文 const app = createApp(App); app.use(router); app.use(pinia); app.use(ElementPlus, { locale: ZhLocale, }); app.use(VueUeditorWrap); app.mount("#app"); // 全局vue异常捕获 app.config.errorHandler = (error, vm, info) => { console.error("Vue 发生错误:", error); console.error("错误信息:", info); router.replace("/index"); };