fix(compiler-core): improve member expression check

fix #3910
This commit is contained in:
Evan You
2021-06-09 11:57:48 -04:00
parent 9a5bdb15df
commit bc100c5c48
3 changed files with 78 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ export const transformModel: DirectiveTransform = (dir, node, context) => {
bindingType &&
bindingType !== BindingTypes.SETUP_CONST
if (!isMemberExpression(expString) && !maybeRef) {
if (!expString.trim() || (!isMemberExpression(expString) && !maybeRef)) {
context.onError(
createCompilerError(ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION, exp.loc)
)