Adding input values into data structure:
<template>
<input
v-for="item in this.inputValues" :key="item.id"
v-model="item.value"
/>
</template>
<script>
export default {
data() {
return {
inputValues: [
{ id: 1 },
{ id: 2 },
{ id: 3 },
{ id: 4 },
{ id: 5 },
{ id: 6 }],
}
},
};
</script>
Would then like a function that essentially does:
{{ this.inputValues[0].value }}
{{ this.inputValues[1].value }}
{{ this.inputValues[2].value }}
{{ this.inputValues[3].value }}
{{ this.inputValues[4].value }}
{{ this.inputValues[5].value }}
My preference would be for this to be outputted into a string, and for the string to only have each value as it is entered and that it be in the correct input order.
inputValuesin computed, getting thevalueparam, and then adding it to a string which is defined in data, but it creates a string that shows "undefinedundefined..." and adds the values on top which isn't what I'd like. Can't quite figure it out.thisinside the template-section. Just a small hint. Just writev-for="item in inputValues"