【发布时间】:2020-11-28 02:21:53
【问题描述】:
所以我尝试使用 :options 的 json 对象列表来显示 b-form-select。它对所有选项都显示为 null,并且 v-model 不存储任何内容,因为它不知道要存储什么值。
<b-form-select v-model="dropDownSelected" :options="listOptions"></b-form-select>
listOptions 是一个 json 对象数组
dropDownSelected 只是一个值。 listOptions 正在通过 axios 正确填充
axios({
method: 'get',
url: 'http://127.0.0.1:8000/Item/?search='+term
}).then(response =>{
console.log('idRequest Data: '+response.data);
if(response.data){
this.listOptions = response.data
}
if (this.listOptions.length === 0) {
console.log('LIST OF ITEMS EMPTY')
}
}
如何在 b-form-select 中正确显示对象列表,并让 v-model 存储指定值?
谢谢
【问题讨论】:
-
能显示response.data的值吗?
标签: vue.js bootstrap-vue