Skip to content

Commit

Permalink
fix(compiler): warn against v-bind with empty attribute value
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 7, 2020
1 parent 6c2402a commit 675330b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/compiler-core/src/transforms/vBind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CAMELIZE } from '../runtimeHelpers'
export const transformBind: DirectiveTransform = (dir, node, context) => {
const { exp, modifiers, loc } = dir
const arg = dir.arg!
if (!exp) {
if (!exp || (exp.type === NodeTypes.SIMPLE_EXPRESSION && !exp.content)) {
context.onError(createCompilerError(ErrorCodes.X_V_BIND_NO_EXPRESSION, loc))
}
// .prop is no longer necessary due to new patch behavior
Expand Down

0 comments on commit 675330b

Please sign in to comment.