Skip to content
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 inside v-for doesn't set value when property name is dynamic #1797

Closed
inca opened this issue Nov 12, 2015 · 1 comment
Closed

v-model inside v-for doesn't set value when property name is dynamic #1797

inca opened this issue Nov 12, 2015 · 1 comment
Labels

Comments

@inca
Copy link

inca commented Nov 12, 2015

As explained in this forum post and demonstrated by this fiddle, if you have something like v-model="obj['prefix-' + key]", you occasionally get this:

Cannot read property "get" of undefined

or that:

[Vue warn]: Invalid setter function body:  'prefix-'+scope.key
@yyx990803
Copy link
Member

Yes, this is a known issue. But in general, the advice is never rely on v-model to create a non-existent property for you. Follow the best practice and properly initialize your data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants