tiny-vue/examples/vue2/src/main.ts

25 lines
644 B
TypeScript

import Vue from 'vue'
import 'uno.css'
import VueI18n from 'vue-i18n'
import { initI18n } from '@opentiny/vue-locale'
import { Loading } from '@opentiny/vue'
import App from '@/App.vue'
Vue.config.productionTip = false
const mode = location.pathname.split('/')[1] || 'pc'
Vue.prototype.tiny_mode = { value: mode }
Vue.prototype.isPcMode = mode === 'pc'
Vue.prototype.isMobileMode = mode === 'mobile'
// 注入全局的saas主题变量
Vue.prototype.tiny_theme = { value: import.meta.env.VITE_TINY_THEME }
Vue.use(VueI18n)
Vue.use(Loading)
new Vue({
i18n: initI18n({ VueI18n, i18n: {} } as any),
render: (h) => h(App)
}).$mount('#app')