【发布时间】:2020-05-30 16:33:05
【问题描述】:
我使用 API 来获取用户。我希望将这些用户绑定到 b-form-select (bootstrap-vue)。但在请求后,我在 b-form-select 中看到“null”。我的要求
getAllUsers() {
axios.get('/GetUsers')
.then(res => {
this.funds = res.data
console.log(this.options1)
})
}
显示数据的表格
<b-form-select
id="input-3"
v-model="userSelect"
:options="funds"
required
></b-form-select>
但是如果我使用
<select v-model="userSelect" class="form-control">
<option v-for="user in funds" :key="user.id" :value="user">{{user.name }} {{user.id }}</option>
</select>
我看到了我的用户。为什么 bootstrap-vue 不能显示我的数据?
【问题讨论】:
-
请添加minimal reproducible example。您当前发布的内容不足以重现,因此请调试您的问题。
标签: javascript vue.js vuejs2 vue-component bootstrap-vue