fix(runtime-core): fix resolving assets from mixins and extends
fix #1963
This commit is contained in:
@@ -24,7 +24,7 @@ import { Slots, initSlots, InternalSlots } from './componentSlots'
|
||||
import { warn } from './warning'
|
||||
import { ErrorCodes, callWithErrorHandling } from './errorHandling'
|
||||
import { AppContext, createAppContext, AppConfig } from './apiCreateApp'
|
||||
import { validateDirectiveName } from './directives'
|
||||
import { Directive, validateDirectiveName } from './directives'
|
||||
import { applyOptions, ComponentOptions } from './componentOptions'
|
||||
import {
|
||||
EmitsOptions,
|
||||
@@ -221,6 +221,17 @@ export interface ComponentInternalInstance {
|
||||
*/
|
||||
renderCache: (Function | VNode)[]
|
||||
|
||||
/**
|
||||
* Resolved component registry, only for components with mixins or extends
|
||||
* @internal
|
||||
*/
|
||||
components: Record<string, ConcreteComponent> | null
|
||||
/**
|
||||
* Resolved directive registry, only for components with mixins or extends
|
||||
* @internal
|
||||
*/
|
||||
directives: Record<string, Directive> | null
|
||||
|
||||
// the rest are only for stateful components ---------------------------------
|
||||
|
||||
/**
|
||||
@@ -372,6 +383,10 @@ export function createComponentInstance(
|
||||
accessCache: null!,
|
||||
renderCache: [],
|
||||
|
||||
// local resovled assets
|
||||
components: null,
|
||||
directives: null,
|
||||
|
||||
// state
|
||||
ctx: EMPTY_OBJ,
|
||||
data: EMPTY_OBJ,
|
||||
@@ -733,7 +748,8 @@ export function formatComponentName(
|
||||
}
|
||||
name =
|
||||
inferFromRegistry(
|
||||
(instance.parent.type as ComponentOptions).components
|
||||
instance.components ||
|
||||
(instance.parent.type as ComponentOptions).components
|
||||
) || inferFromRegistry(instance.appContext.components)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user