From: Stanislav Lashmanov Date: Sun, 6 Oct 2019 15:38:05 +0000 (+0300) Subject: fix: expose Vue to compiled template (#120) X-Git-Tag: v3.0.0-alpha.0~579 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7a9c25f145a1db63e1dfd1902750c04488f27da;p=thirdparty%2Fvuejs%2Fcore.git fix: expose Vue to compiled template (#120) This removes the reliance on `Vue` being exposed as a global. --- diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts index d4604ad91d..3ad4bca05c 100644 --- a/packages/vue/src/index.ts +++ b/packages/vue/src/index.ts @@ -1,6 +1,7 @@ // This package is the "full-build" that includes both the runtime // and the compiler, and supports on-the-fly compilation of the template option. import { compile, CompilerOptions } from '@vue/compiler-dom' +import * as runtimeDom from '@vue/runtime-dom' import { registerRuntimeCompiler, RenderFunction } from '@vue/runtime-dom' function compileToFunction( @@ -11,7 +12,7 @@ function compileToFunction( hoistStatic: true, ...options }) - return new Function(code)() as RenderFunction + return new Function('Vue', code)(runtimeDom) as RenderFunction } registerRuntimeCompiler(compileToFunction)