如何在 v-model 中给出我的数组天数的索引?
<select v-model="dayList" id="dayList">
<option v-for="(day, index) in days" :key="index">{{ selectDaysLabel(day) }}</option>
</select>
和:
dayList(index) {
console.log(index) // should give you either 0, 1, 2...
}
谢谢您的帮助 !