types: fix type error
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
// import type { App } from 'vue'
|
||||
import type { AppContext, Plugin } from 'vue'
|
||||
|
||||
// 需要全局引入一些组件,如ElScrollbar,不然一些下拉项样式有问题
|
||||
import { ElLoading, ElScrollbar } from 'element-plus'
|
||||
|
||||
const plugins = [ElLoading]
|
||||
const plugins = [ElLoading] as Plugin[]
|
||||
|
||||
const components = [ElScrollbar]
|
||||
|
||||
export const setupElementPlus = (app: any) => {
|
||||
export const setupElementPlus = (app: AppContext['app']) => {
|
||||
plugins.forEach((plugin) => {
|
||||
app.use(plugin)
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// import type { App } from 'vue'
|
||||
import type { AppContext, Plugin } from 'vue'
|
||||
import { createI18n } from 'vue-i18n'
|
||||
import { useLocaleStoreWithOut } from '@/store/modules/locale'
|
||||
import type { I18n, I18nOptions } from 'vue-i18n'
|
||||
@@ -35,8 +35,8 @@ const createI18nOptions = async (): Promise<I18nOptions> => {
|
||||
}
|
||||
}
|
||||
|
||||
export const setupI18n = async (app: any) => {
|
||||
export const setupI18n = async (app: AppContext['app']) => {
|
||||
const options = await createI18nOptions()
|
||||
i18n = createI18n(options) as I18n
|
||||
app.use(i18n)
|
||||
app.use(i18n as Plugin)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user