-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v-model value must be a valid JavaScript member expression #3910
Comments
/cc @HcySunYang |
RegExp cannot cover all use cases, maybe it is more reasonable to use babel to check the validity of expressions, but considering the compiler in the browser environment, including babel is not a good solution. |
Made a PR |
@HcySunYang with the new pr this will fail.
if you can't use a parser to validate the expression,due to the concern of bundling babel in browser build |
@yyx990803 I updated to vue 3.1.2 and still get the error temporary work around i use
|
@JoeriTheGreat It seems to be working with the given example on this issue. Maybe it's a compat bug but I'm unsure if the compiler does a different work on compat mode |
Version
3.1.0-beta.6
Reproduction link
https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8cD57e3Rlc3REYXRhWzBdWzBdfX08L3A+XG4gIDxpbnB1dCB2LW1vZGVsPVwidGVzdERhdGFbMF1bMF1cIj5cbjwvdGVtcGxhdGU+XG5cbjxzY3JpcHQ+XG4gIGV4cG9ydCBkZWZhdWx0IHtcbiAgICBuYW1lOiAnYXBwJyxcbiAgICBkYXRhKCkge1xuICAgICAgcmV0dXJuIHtcbiAgICAgICAgdGVzdERhdGE6IFtbXCIxXCIsIFwiMlwiXSwgW1wiM1wiLCBcIjRcIl1dXG4gICAgICB9XG4gICAgfVxuICB9XG48L3NjcmlwdD5cbiJ9
Steps to reproduce
Access a 2D array with a v-model command in vue 3.1.0-beta6 and newer.
What is expected?
Access/model the element of the array without an error message.
What is actually happening?
It will throw an error telling you "v-model value must be a valid JavaScript member expression".
Interestingly this does not seem to be a problem with v-bind.
Earlier versions, including 3.0.11, are working just fine.
Has already been reported in #3891, but was closed due to missing example.
The text was updated successfully, but these errors were encountered: