In my vue
-application I want to assign some values from an xls
-file to some options in a select.
<tr v-for="header in fileHeaders" :key="header">
<td>{{header}}</td>
<td>
<select class="form-control" v-model="selectedField" v-on:change="setField">
<option selected>Choose option</option>
<option value="company_name">Company name</option>
<option value="address">Address</option>
<option value="zipcode">Zipcode</option>
<option value="city">City</option>
<option value="email">Email</option>
<option value="number">Phonenumber</option>
<option value="contact_person">Contact person</option>
<option value="cvr_number">ID</option>
</select>
</td>
</tr>
data() {
return {
fileHeaders: ['Company Name', 'Zipcode', 'City' etc.],
selectedField: "",
chosenFields: []
};
}
so for each {{header}}
I want to assign a specific option from the select and then I want to push an array to the backend with the assigned values but I don't really know how to achieve that or where to start...
Any ideas?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…