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
How to add a new property to vue (object) data? #3340
Comments
Read the docs: Vue.set |
Thanks, using the set method, and It's OK now.
|
The previous solution does not work for me (Vue ^ 3.0.0)
|
|
You don't need it in Vue 3, only in Vue 2. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
My data goes below
I could use this method to add new contact, but it got a compatibility problem, so I wonder are there some other ways to add new property to object, or I'd better change to use array instead of object.
this.contacts = Object.assign({}, this.contacts, newObj);
Thanks a lot.
The text was updated successfully, but these errors were encountered: