Is this correct way to update object props using v-model? #12587
Unanswered
Lineez
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have some big form and collect my data in one object. I using ref for this object and usually need update all fields. And my qustion: is correct way or is props mutating? It's looks like js native object. If we change property -> we don't change object.
My take is not directly props mutating because we don't change object itself.
I understand that we can use computed or emit for this, but it's look overhead. For example what if we need 20+ form field = 20 computed \ copy all data from props, define new ref and accumulate with new data (emit for every field trigger?)
Link with example: https://play.vuejs.org/#eNqFUsFOwzAM/RUrlw5ptBobl9JNArQDHGACjpFQ1bldR5tESVomVf13nHQbE2Jwau3nPD/7uWO3SoVtgyxmicl0qSwYtI1acFHWSmoLHWjMoYdcyxoCKg2O0L2s1T4fRi5wTMENF1xkUhgLudQ1zB3BqOMCoDZFDMHkajoLxlz0F1wk0dCV+lFgsVZVapEigGQzWXSd5wjpIfR9ElHKQ75z7KA5Z+7DGUQEJdEJBRsza0hIXhbh1khBM3oVnGX0vKxQPytbklDOYvCIw9Kqkp+PPmd1g6RzyGcbzD5+yW/NzuU4W2k0qFvk7IjZVBdoB3j5+oQ7+j+CtVw3FVX/Ab6gkVXjNA5ld41Yk+yTOq/2wdtRiuLNLHcWhTkM5YS6yt7Xc0b2uM2dG/1b7jSc+XdkEm3xYO3PI4EqFQUZYImG9j14rrRUhkxfY14KXLko8R2cTdRsOAJjNel1/IvRP2dQCtVYaC9pJVjt7XYHccby9xa1WwCJnYbX4WTK+i8mgfbd
Beta Was this translation helpful? Give feedback.
All reactions