[Vuejs]-VueJS: Dynamic v-model inside v-for

1👍

You can make use of computed properties

export default {
  data() {
    return {
      inputs: [
        { id: 1, name: "Customer Name", vmodel: "customer Name" },
        { id: 2, name: "Router Hostname", vmodel: "host Name" }
      ]
    };
  },
  computed: {
    customerName() {
      return this.inputs[0].vmodel;
    },
    hostName() {
      return this.inputs[1].vmodel;
    }
  }
};

Leave a comment