- 构建:Vue CLI 4 → Vite 5,入口迁至根 index.html(含 env-config + 主题通道 loader)
- 技术栈:Vue 2.6 → Vue 3.4,view-design → view-ui-plus 1.3.24,vue-router 3 → 4(hash)
- 壳层重写:App.vue / components/layout.vue 对齐 Notice 骨架(logo-badge、icon-* 通道图标、resolveMenuPage、crumb-home 基线)
- 机械转换:具名 slot → template #x、.sync → v-model:、@click.native、$set、beforeDestroy、/deep/ → :deep()
- render:h('Button')/h('Input') → 真组件 + 扁平 props/onClick
- 组件适配:vuedraggable 4 的 #item 插槽;vue-treeselect → @zanmato/vue3-treeselect;Page 分页改 v-model + pageSize 显式回写
- 清理:删除 Vue2 死代码(layout_old/bak/child、App.Net、codeModal、未引用组件)
- 修复:深链接首次加载被重定向到首个模块(router.isReady)
验证:vite build 通过;headless CDP 全 15 路由无异常;教师列表 2 行渲染、操作列按钮点击弹窗正常。
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { createApp } from "vue";
|
||
import { createPinia } from "pinia";
|
||
|
||
import App from "./App.vue";
|
||
import router from "@/router";
|
||
|
||
import ViewUIPlus from "view-ui-plus";
|
||
import "view-ui-plus/dist/styles/viewuiplus.css";
|
||
|
||
// 布局/主题/图标(base.layout.css + icons.css)由中央静态通道下发:
|
||
// index.html 的 yh-theme-init.js 在 DOMContentLoaded 后按 manifest 版本追加 <link>,
|
||
// 天然排在本文件组件库样式之后。
|
||
import "@/assets/styles/main.scss";
|
||
|
||
import api from "@/api";
|
||
import utils from "@/utils";
|
||
import conf from "@/assets/config/host.config";
|
||
import bus from "@/utils/bus";
|
||
import registerDirectives from "@/utils/directive";
|
||
import APIConfig from "@/config/apiConf";
|
||
|
||
const app = createApp(App);
|
||
|
||
app.use(createPinia());
|
||
app.use(router);
|
||
app.use(ViewUIPlus);
|
||
|
||
// 兼容存量代码:全局 APIConfig / conf,以及 Vue2 时代的四个原型方法
|
||
(window as any).APIConfig = APIConfig;
|
||
(window as any).conf = conf;
|
||
|
||
app.config.globalProperties.$api = api;
|
||
app.config.globalProperties.$utils = utils;
|
||
app.config.globalProperties.$conf = conf;
|
||
app.config.globalProperties.$bus = bus;
|
||
|
||
registerDirectives(app);
|
||
|
||
app.mount("#app");
|