[Vuejs]-How to record multidimensional arrays from forms with Vue?

0👍

Make an Object:

 data: {
      form: [{}]
 },

If this is your array:

list = [
    [value, is_current],
    [value, is_current],
    [value, is_current],
];

Then go over this array and add each inner array to the object:

  list.forEach(function(element) {
        that.form.push({value: element[0], key: element[1]});
  });

See this fiddle for reference:

https://jsfiddle.net/mnd8ojLh/1/

👤Rence

Leave a comment