<el-col :span="8" v-for = "(item,index) in addFile" :key="index">
<el-form-item :label="item+":"" >
<el-input v-model="__?___" size="small"></el-input>
</el-form-item>
</el-col>
"addFileds":[
{
"annualAdvance":"",
"unionDues":"",
"socialSupplementaryInsurance":"",
"endowmentInsurance":"",
"unemploymentInsurance":"",
"medicalInsurance":"",
"basiceLifeFee":"",
"medicalSubsidies":"",
"welfare":"",
"highTemperatureAlpine":"/",
"projectAdvance":"",
"enterpriseAnnuity":"",
"mealSubsidies":"",
"employmentInjuryInsurance":"",
"maternityInsurance":"",
"trafficSubsidy":"",
"onlyChild":"",
"postSalary":"",
"performanceAdvance":"",
"housingFund":"",
"communication":""
}
]
I want to traverse this data through v-for, and then let each input box bind a different value. How do I write it here?
what I have written in this way is the effect of the above picture, but I don"t want English to be displayed in the input box. I don"t know how to write v-model? Ask the god for advice!
<el-form ref="form" :model="form" label-width="110px">
<el-row style="line-height:40px" :gutter="20">
<el-col :span="8" v-for = "(item,index) in addFile" :key="index">
<el-form-item :label="item+":"" >
<el-input v-model="index" size="small" ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>