instance.render = Component.render as InternalRenderFunction
}
} else if (!instance.render) {
+ // could be set from setup()
if (compile && Component.template && !Component.render) {
if (__DEV__) {
startMeasure(instance, `compile`)
;(Component.render as InternalRenderFunction)._rc = true
}
- if (__DEV__ && !Component.render) {
- /* istanbul ignore if */
- if (!compile && Component.template) {
- warn(
- `Component provided template option but ` +
- `runtime compilation is not supported in this build of Vue.` +
- (__ESM_BUNDLER__
- ? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
- : __ESM_BROWSER__
- ? ` Use "vue.esm-browser.js" instead.`
- : __GLOBAL__
- ? ` Use "vue.global.js" instead.`
- : ``) /* should not happen */
- )
- } else {
- warn(`Component is missing template or render function.`)
- }
- }
-
instance.render = (Component.render || NOOP) as InternalRenderFunction
// for runtime-compiled render functions using `with` blocks, the render
applyOptions(instance, Component)
currentInstance = null
}
+
+ // warn missing template/render
+ if (__DEV__ && !Component.render && instance.render === NOOP) {
+ /* istanbul ignore if */
+ if (!compile && Component.template) {
+ warn(
+ `Component provided template option but ` +
+ `runtime compilation is not supported in this build of Vue.` +
+ (__ESM_BUNDLER__
+ ? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
+ : __ESM_BROWSER__
+ ? ` Use "vue.esm-browser.js" instead.`
+ : __GLOBAL__
+ ? ` Use "vue.global.js" instead.`
+ : ``) /* should not happen */
+ )
+ } else {
+ warn(`Component is missing template or render function.`)
+ }
+ }
}
const attrHandlers: ProxyHandler<Data> = {
SetupContext,
ComponentInternalOptions,
PublicAPIComponent,
- Component
+ Component,
+ InternalRenderFunction
} from './component'
import {
isFunction,
deactivated,
beforeUnmount,
unmounted,
+ render,
renderTracked,
renderTriggered,
errorCaptured
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) {
// global mixins are applied first
applyMixins(instance, globalMixins, deferredData, deferredWatch)
}
+
// extending a base component...
if (extendsOptions) {
applyOptions(instance, extendsOptions, deferredData, deferredWatch, true)