图表 init 前先 document.fonts.load 字形:zrender 按字体缓存文字宽度且不清空, 字体未到就量会让时间轴标签叠成一团。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
41 行
1.5 KiB
JavaScript
41 行
1.5 KiB
JavaScript
import { createApp } from 'vue'
|
||
import { createRouter, createWebHistory } from 'vue-router'
|
||
import ElementPlus from 'element-plus'
|
||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||
import 'element-plus/dist/index.css'
|
||
import 'element-plus/theme-chalk/dark/css-vars.css'
|
||
// 字体随前端打包,不靠系统字体 —— Windows / Mac / 安卓 / iPhone 看到的一样。
|
||
// 中文 Noto Sans SC(可变字重,按 unicode-range 分成约 100 片,浏览器只下用到的那几片);
|
||
// 读数 Barlow(DIN 风格,带 tnum 等宽数字),只要拉丁子集。
|
||
import '@fontsource-variable/noto-sans-sc'
|
||
import '@fontsource/barlow/latin-400.css'
|
||
import '@fontsource/barlow/latin-500.css'
|
||
import '@fontsource/barlow/latin-600.css'
|
||
import '@fontsource/barlow/latin-700.css'
|
||
import './theme.css'
|
||
import './theme'
|
||
|
||
import App from './App.vue'
|
||
import Overview from './pages/Overview.vue'
|
||
import Board from './pages/Board.vue'
|
||
import Events from './pages/Events.vue'
|
||
import Audit from './pages/Audit.vue'
|
||
import Recovery from './pages/Recovery.vue'
|
||
import Firmware from './pages/Firmware.vue'
|
||
import { connect } from './store'
|
||
|
||
const router = createRouter({
|
||
history: createWebHistory(),
|
||
routes: [
|
||
{ path: '/', component: Overview },
|
||
{ path: '/board/:id', component: Board, props: true },
|
||
{ path: '/events', component: Events },
|
||
{ path: '/audit', component: Audit },
|
||
{ path: '/recovery', component: Recovery },
|
||
{ path: '/firmware', component: Firmware },
|
||
],
|
||
})
|
||
|
||
connect()
|
||
createApp(App).use(router).use(ElementPlus, { locale: zhCn }).mount('#app')
|