fix(vue): make the Vue in render function context same as the runtime context

This commit is contained in:
tyx1703 2022-01-01 17:34:30 +08:00
parent 7007ffb2c7
commit 6771a20fc8
1 changed files with 5 additions and 1 deletions

View File

@ -75,7 +75,11 @@ function compileToFunction(
// In the global build we know `Vue` is available globally so we can avoid
// the wildcard object.
const render = (
__GLOBAL__ ? new Function(code)() : new Function('Vue', code)(runtimeDom)
__GLOBAL__
// https://github.com/vuejs/vue-next/issues/5196
// @ts-ignore
? new Function('Vue', code)(Vue)
: new Function('Vue', code)(runtimeDom)
) as RenderFunction
// mark the function as runtime compiled