mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-03 19:58:09 +08:00
parent
bbcd54ce7f
commit
3d77bcd29b
@ -6,12 +6,13 @@ import type { ConfigProviderContext } from '@element-plus/tokens'
|
|||||||
const INSTALLED_KEY = Symbol('INSTALLED_KEY')
|
const INSTALLED_KEY = Symbol('INSTALLED_KEY')
|
||||||
|
|
||||||
export const makeInstaller = (components: Plugin[] = []) => {
|
export const makeInstaller = (components: Plugin[] = []) => {
|
||||||
const install = (app: App, options: ConfigProviderContext = {}) => {
|
const install = (app: App, options?: ConfigProviderContext) => {
|
||||||
if (app[INSTALLED_KEY]) return
|
if (app[INSTALLED_KEY]) return
|
||||||
|
|
||||||
app[INSTALLED_KEY] = true
|
app[INSTALLED_KEY] = true
|
||||||
components.forEach((c) => app.use(c))
|
components.forEach((c) => app.use(c))
|
||||||
provideGlobalConfig(options, app, true)
|
|
||||||
|
if (options) provideGlobalConfig(options, app, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user