diff --git a/packages/compiler-core/src/index.ts b/packages/compiler-core/src/index.ts index 7cc6219c1..03388b1f7 100644 --- a/packages/compiler-core/src/index.ts +++ b/packages/compiler-core/src/index.ts @@ -7,7 +7,8 @@ export { TransformOptions, CodegenOptions, HoistTransform, - BindingMetadata + BindingMetadata, + BindingTypes } from './options' export { baseParse, TextModes } from './parse' export { diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 70b502d58..a82db356d 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1,5 +1,5 @@ import MagicString from 'magic-string' -import { BindingMetadata } from '@vue/compiler-core' +import { BindingMetadata, BindingTypes } from '@vue/compiler-core' import { SFCDescriptor, SFCScriptBlock } from './parse' import { parse as _parse, ParserOptions, ParserPlugin } from '@babel/parser' import { babelParserDefaultPlugins, generateCodeFrame } from '@vue/shared' @@ -26,7 +26,6 @@ import { walk } from 'estree-walker' import { RawSourceMap } from 'source-map' import { genCssVarsCode, injectCssVarsCalls } from './genCssVars' import { compileTemplate, SFCTemplateCompileOptions } from './compileTemplate' -import { BindingTypes } from 'packages/compiler-core/src/options' const USE_OPTIONS = 'useOptions' diff --git a/packages/template-explorer/src/options.ts b/packages/template-explorer/src/options.ts index b94bee722..3428aaceb 100644 --- a/packages/template-explorer/src/options.ts +++ b/packages/template-explorer/src/options.ts @@ -1,5 +1,6 @@ import { h, reactive, createApp, ref } from 'vue' import { CompilerOptions } from '@vue/compiler-dom' +import { BindingTypes } from '@vue/compiler-core' export const ssrMode = ref(false) @@ -12,9 +13,9 @@ export const compilerOptions: CompilerOptions = reactive({ scopeId: null, ssrCssVars: `{ color }`, bindingMetadata: { - TestComponent: 'setup', - foo: 'setup', - bar: 'props' + TestComponent: BindingTypes.SETUP, + foo: BindingTypes.SETUP, + bar: BindingTypes.PROPS } })