V-model binding problem

problem description

I want to make sure that the input of each input box does not interfere with each other, and the data entered in each row can be different. It should be the wrong way of writing my v-model

.

the environmental background of the problems and what methods you have tried

how can I make sure that the values of v-model bindings do not all correspond to the same? My idea is to add an array, but the error field is not defined

related codes

/ / Please paste the code text below (do not replace the code with pictures)

<tr ref="postInfo[index]" v-for="(value,index) in items" :id="index">
    <td><i-input v-model="STOCKCODE" size="small" placeholder=""/></td>
    <td><i-input v-model="QUANTITY" size="small" placeholder=""/></td>
    <td><i-input v-model="PRICE" size="small" placeholder=""/></td>
    <td><i-input v-model="BUSINESS" size="small" placeholder=""/></td>
    <td class="green_bg4">A</td>
    <td class="green_bg4">1</td>
    <td class="green_bg4">1</td>
    <td class="green_bg4">9</td>
    <td class="green_bg4">5</td>
    <td class="green_bg4">5555</td>
</tr>

what result do you expect? What is the error message actually seen?

Sep.07,2021

ref= "postInfo [index]"

is there a definition for postInfo [index]

The idea of

is correct, but postInfo is an empty array, so postInfo [index] is a postInfo.xxx of course you report an error. You need to traverse items beforehand to generate postInfo = [{}, {},.], or just put the data in each item of items

.
Menu