[Vuejs]-How to get value from a looped table, trigger a function that stores that value in an array in vue

2👍

You should use computed property; Here’s the code:

data() {
  return {
    myValues: [1,2,3,4],
  };
},
computed: {
  newValues() {
    const newValues = []
    this.myValues.forEach(v => newValues.push(v + 1));
    return newValues;
  },
},

Leave a comment