fix(v-model): should use dynamic directive on input with dynamic v-bind

This commit is contained in:
Evan You
2020-02-05 15:21:47 -05:00
parent ae92925011
commit 1f2de9e232
6 changed files with 72 additions and 11 deletions

View File

@@ -3,7 +3,8 @@ import {
DirectiveTransform,
ElementTypes,
findProp,
NodeTypes
NodeTypes,
hasDynamicKeyVBind
} from '@vue/compiler-core'
import { createDOMCompilerError, DOMErrorCodes } from '../errors'
import {
@@ -75,6 +76,10 @@ export const transformModel: DirectiveTransform = (dir, node, context) => {
break
}
}
} else if (hasDynamicKeyVBind(node)) {
// element has bindings with dynamic keys, which can possibly contain
// "type".
directiveToUse = V_MODEL_DYNAMIC
} else {
// text type
__DEV__ && checkDuplicatedValue()