| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import { createApp } from 'vue'
- import { createPinia } from 'pinia'
- import App from './App.vue'
- import en from './views/lang/en.json'
- import cn from './views/lang/cn.json'
- import hk from './views/lang/hk.json'
- export let lang = cn
- if (window.location.href.includes('cocorobo.cn')) {
- lang = cn
- }
- else if (window.location.href.includes('cocorobo.hk')) {
- lang = hk
- }
- else if (window.location.href.includes('cocorobo.com')) {
- lang = en
- }
- else {
- lang = cn
- }
- // TypeScript declarations for global properties
- declare module '@vue/runtime-core' {
- interface ComponentCustomProperties {
- $version: 'cn' | 'hk' | 'com'
- }
- }
- import '@icon-park/vue-next/styles/index.css'
- import 'prosemirror-view/style/prosemirror.css'
- import 'animate.css'
- import '@/assets/styles/prosemirror.scss'
- import '@/assets/styles/global.scss'
- import '@/assets/styles/font.scss'
- import Icon from '@/plugins/icon'
- import Directive from '@/plugins/directive'
- // 全局变量:判断当前版本 (cn/hk/com)
- export const getCurrentVersion = () => {
- const href = window.location.href.toLowerCase()
- if (href.includes('cn')) return 'cn'
- if (href.includes('hk')) return 'hk'
- if (href.includes('com')) return 'com'
- return 'cn' // 默认cn版本
- }
- // 当前版本
- export const currentVersion = getCurrentVersion()
- export default {currentVersion, lang}
- const app = createApp(App)
- // 注册全局变量
- app.config.globalProperties.$version = currentVersion
- app.use(Icon)
- app.use(Directive)
- app.use(createPinia())
- app.mount('#app')
|