fix: global config when undefined (#6777)

closes #6760
This commit is contained in:
三咲智子 2022-03-23 18:30:50 +08:00 committed by GitHub
parent bbcd54ce7f
commit 3d77bcd29b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,12 +6,13 @@ import type { ConfigProviderContext } from '@element-plus/tokens'
const INSTALLED_KEY = Symbol('INSTALLED_KEY')
export const makeInstaller = (components: Plugin[] = []) => {
const install = (app: App, options: ConfigProviderContext = {}) => {
const install = (app: App, options?: ConfigProviderContext) => {
if (app[INSTALLED_KEY]) return
app[INSTALLED_KEY] = true
components.forEach((c) => app.use(c))
provideGlobalConfig(options, app, true)
if (options) provideGlobalConfig(options, app, true)
}
return {