<v-layout row wrap>
<v-flex class="hidden-sm-and-down" md4>
<v-subheader class="fields">Select Venue</v-subheader>
</v-flex>
<v-flex xs12 md8>
<v-select class="select__box" :items="venues" v-model="venue" item-text="name" item-value="_id" label="Select Venue" prepend-icon="edit_location" autocomplete :error-messages="venueErrors" @blur="delayTouch($v.venue,200)" @input="delayTouch($v.venue,200)"></v-select>
</v-flex>
</v-layout>
created: async function() {
try {
let response = await CommonRequest.getVenues();
let array = response.data.venues;
let i = 0;
for (let ven of array) {
this.venues[i] = Object.assign({}, this.venues, {
name: ven.name,
_id: ven._id
});
i++;
}
} catch (error) {
if (error) console.log(error);
}
}
这里的场所列表 id 仅在我刷新页面后才会更新。即使数据是之前到达的(正如我所做的那样 console.log(this.venues) 检查数据是否到达)