You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.7 KiB
55 lines
1.7 KiB
import 'element-plus/dist/index.css'
|
|
import 'assets/styles/main.scss'
|
|
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
import BTButton from 'components/common/BTButton/index.vue'
|
|
import FtButton from 'components/common/FTButton/index.vue'
|
|
import FtDialog from 'components/common/FTDialog/index.vue'
|
|
import FtInput from 'components/common/FTInput/index.vue'
|
|
import FtTable from 'components/common/FTTable/index.vue'
|
|
import ElementPlus from 'element-plus'
|
|
import locale from 'element-plus/es/locale/lang/zh-cn'
|
|
import ErrorBox from 'libs/modalUtil'
|
|
import pinia from 'stores/index'
|
|
import { createApp } from 'vue'
|
|
import { createI18n } from 'vue-i18n'
|
|
|
|
import App from './app.vue'
|
|
import type { LocaleType } from './lang'
|
|
import { defaultLocale, messages } from './lang'
|
|
import router from './router'
|
|
|
|
// 创建 i18n 实例
|
|
const i18n = createI18n<{
|
|
locale: LocaleType
|
|
messages: {
|
|
en: typeof messages.en
|
|
zh: typeof messages.zh
|
|
}
|
|
}>({
|
|
legacy: false,
|
|
locale: (localStorage.getItem('locale') as LocaleType) || defaultLocale,
|
|
fallbackLocale: 'en',
|
|
messages,
|
|
})
|
|
|
|
const app = createApp(App)
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
app.component(key, component)
|
|
}
|
|
app.directive('prevent-keyboard', {
|
|
mounted(el) {
|
|
console.log('el---', el)
|
|
// 阻止输入框自动聚焦
|
|
// el.querySelector('input').setAttribute('readonly', 'readonly')
|
|
},
|
|
})
|
|
app.config.warnHandler = () => null
|
|
app.use(pinia)
|
|
app.use(ErrorBox)
|
|
app.component('BtButton', BTButton)
|
|
app.component('FtTable', FtTable)
|
|
app.component('FtButton', FtButton)
|
|
app.component('FtDialog', FtDialog)
|
|
app.component('FtInput', FtInput)
|
|
app.use(router).use(i18n).use(ElementPlus, { locale, zIndex: 3000 }).mount('#app')
|