[Vuejs]-Vuex โ€“ Form Handling with dynamic Data

0๐Ÿ‘

I am not exactly getting what you are trying to achieve and what is the error you are getting. But I noticed following mistakes you are doing in the code you have shared.

  1. you have v-for="(value, key, index) in values" which is not correct syntax and will not work, you will have to write it like: v-for="(value, index) in values" use the hash: value as par your requirement. see example of this here.
  2. You have v-model="some_dynamicly_set_vuex_state", which is not possible as you can only change vuex state by a mutation, so instead of vuex state, you can have some other variable and you can have a watcher on that variable, whenever that variable changes, mutate the vuex state.
  3. you can not have a computed property which can take a parameter, as you are trying to do in v-model="model(value)", you can do it as methods like you have shown.

If you can create a sample jsfiddle of the thing you are trying to do, and explain the error you are getting, it will be helpful in finding the exact problem.

๐Ÿ‘คSaurabh

Leave a comment