fix(runtime-core): respect render function from mixins

fix #1630
This commit is contained in:
Evan You
2020-07-27 17:44:17 -04:00
parent 71c3c6e2a0
commit 354d79c42b
3 changed files with 40 additions and 21 deletions

View File

@@ -4,7 +4,8 @@ import {
SetupContext,
ComponentInternalOptions,
PublicAPIComponent,
Component
Component,
InternalRenderFunction
} from './component'
import {
isFunction,
@@ -390,6 +391,7 @@ export function applyOptions(
deactivated,
beforeUnmount,
unmounted,
render,
renderTracked,
renderTriggered,
errorCaptured
@@ -398,7 +400,10 @@ export function applyOptions(
const publicThis = instance.proxy!
const ctx = instance.ctx
const globalMixins = instance.appContext.mixins
// call it only during dev
if (asMixin && render && instance.render === NOOP) {
instance.render = render as InternalRenderFunction
}
// applyOptions is called non-as-mixin once per instance
if (!asMixin) {
@@ -406,6 +411,7 @@ export function applyOptions(
// global mixins are applied first
applyMixins(instance, globalMixins, deferredData, deferredWatch)
}
// extending a base component...
if (extendsOptions) {
applyOptions(instance, extendsOptions, deferredData, deferredWatch, true)