fix(compat): fix app-level asset registration affecting other local apps (#5979)

This commit is contained in:
Alex Van Liew
2022-05-22 18:41:39 -07:00
committed by GitHub
parent 7fbc933f4d
commit 7fb57327b9
2 changed files with 25 additions and 2 deletions

View File

@@ -381,9 +381,10 @@ function installLegacyAPIs(app: App) {
function applySingletonAppMutations(app: App) {
// copy over asset registries and deopt flag
;['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
app._context.mixins = [...singletonApp._context.mixins]
;['components', 'directives', 'filters'].forEach(key => {
// @ts-ignore
app._context[key] = singletonApp._context[key]
app._context[key] = Object.create(singletonApp._context[key])
})
// copy over global config mutations