fix: runtime compilation marker should be applied in exposed compile function
This commit is contained in:
parent
a5e55e28f1
commit
b3b65b4058
@ -601,8 +601,6 @@ function finishComponentSetup(
|
|||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
endMeasure(instance, `compile`)
|
endMeasure(instance, `compile`)
|
||||||
}
|
}
|
||||||
// mark the function as runtime compiled
|
|
||||||
;(Component.render as InternalRenderFunction)._rc = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
instance.render = (Component.render || NOOP) as InternalRenderFunction
|
instance.render = (Component.render || NOOP) as InternalRenderFunction
|
||||||
|
@ -5,6 +5,7 @@ import { compile, CompilerOptions, CompilerError } from '@vue/compiler-dom'
|
|||||||
import { registerRuntimeCompiler, RenderFunction, warn } from '@vue/runtime-dom'
|
import { registerRuntimeCompiler, RenderFunction, warn } from '@vue/runtime-dom'
|
||||||
import * as runtimeDom from '@vue/runtime-dom'
|
import * as runtimeDom from '@vue/runtime-dom'
|
||||||
import { isString, NOOP, generateCodeFrame, extend } from '@vue/shared'
|
import { isString, NOOP, generateCodeFrame, extend } from '@vue/shared'
|
||||||
|
import { InternalRenderFunction } from 'packages/runtime-core/src/component'
|
||||||
|
|
||||||
__DEV__ && initDev()
|
__DEV__ && initDev()
|
||||||
|
|
||||||
@ -74,6 +75,10 @@ function compileToFunction(
|
|||||||
const render = (__GLOBAL__
|
const render = (__GLOBAL__
|
||||||
? new Function(code)()
|
? new Function(code)()
|
||||||
: new Function('Vue', code)(runtimeDom)) as RenderFunction
|
: new Function('Vue', code)(runtimeDom)) as RenderFunction
|
||||||
|
|
||||||
|
// mark the function as runtime compiled
|
||||||
|
;(render as InternalRenderFunction)._rc = true
|
||||||
|
|
||||||
return (compileCache[key] = render)
|
return (compileCache[key] = render)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user