forked from zhongyidian/super_video
完善课程资源、学习进度与技能树解锁体验,统一视频播放与引导相关交互。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
34 lines
939 B
TypeScript
34 lines
939 B
TypeScript
import { createApp } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
|
import './style.css'
|
|
import App from './App.vue'
|
|
import router from './router'
|
|
|
|
// 在开发模式的移动端启用 vConsole(需先安装 vconsole 依赖)
|
|
if (import.meta.env.DEV && typeof window !== 'undefined') {
|
|
const ua = window.navigator.userAgent.toLowerCase()
|
|
const isMobile = /iphone|ipad|ipod|android|mobile/.test(ua)
|
|
|
|
if (isMobile) {
|
|
// 动态加载,避免生产环境打包 & 未安装时报错
|
|
import('vconsole')
|
|
.then((mod) => {
|
|
const VConsole = (mod as any).default || (mod as any)
|
|
|
|
new VConsole()
|
|
})
|
|
.catch(() => {
|
|
// vconsole 未安装或加载失败时静默忽略
|
|
})
|
|
}
|
|
}
|
|
|
|
const app = createApp(App)
|
|
const pinia = createPinia()
|
|
pinia.use(piniaPluginPersistedstate)
|
|
|
|
app.use(pinia)
|
|
app.use(router)
|
|
app.mount('#app')
|