16 lines
507 B
TypeScript
16 lines
507 B
TypeScript
// plugins\element-plus.ts
|
|
import { defineNuxtPlugin } from '#app'
|
|
import '~/style/element/index.scss'
|
|
import { ID_INJECTION_KEY } from 'element-plus';
|
|
// 引入中文包
|
|
import locale from 'element-plus/lib/locale/lang/zh-cn'
|
|
import ElementPlus from 'element-plus'
|
|
export default defineNuxtPlugin(nuxtApp => {
|
|
// Doing something with nuxtApp
|
|
nuxtApp.vueApp.provide(ID_INJECTION_KEY, {
|
|
prefix: Math.floor(Math.random() * 10000),
|
|
current: 0,
|
|
})
|
|
|
|
nuxtApp.vueApp.use(ElementPlus, { locale })
|
|
}) |