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

@@ -205,6 +205,17 @@ export function findProp(
}
}
export function hasDynamicKeyVBind(node: ElementNode): boolean {
return node.props.some(
p =>
p.type === NodeTypes.DIRECTIVE &&
p.name === 'bind' &&
(!p.arg || // v-bind="obj"
p.arg.type !== NodeTypes.SIMPLE_EXPRESSION || // v-bind:[_ctx.foo]
!p.arg.isStatic) // v-bind:[foo]
)
}
export function createBlockExpression(
blockExp: BlockCodegenNode,
context: TransformContext