fix(v-model): allow v-model usage on declared custom elements

fix #1699
This commit is contained in:
Evan You
2020-07-27 17:09:21 -04:00
parent 2a633c84ff
commit 71c3c6e2a0
5 changed files with 43 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ export interface ParserOptions {
/**
* Separate option for end users to extend the native elements list
*/
isCustomElement?: (tag: string) => boolean
isCustomElement?: (tag: string) => boolean | void
/**
* Get tag namespace
*/
@@ -83,6 +83,10 @@ export interface TransformOptions {
* for them.
*/
isBuiltInComponent?: (tag: string) => symbol | void
/**
* Used by some transforms that expects only native elements
*/
isCustomElement?: (tag: string) => boolean | void
/**
* Transform expressions like {{ foo }} to `_ctx.foo`.
* If this option is false, the generated code will be wrapped in a

View File

@@ -117,6 +117,7 @@ export function createTransformContext(
directiveTransforms = {},
transformHoist = null,
isBuiltInComponent = NOOP,
isCustomElement = NOOP,
expressionPlugins = [],
scopeId = null,
ssr = false,
@@ -134,6 +135,7 @@ export function createTransformContext(
directiveTransforms,
transformHoist,
isBuiltInComponent,
isCustomElement,
expressionPlugins,
scopeId,
ssr,