【发布时间】:2021-01-22 08:34:12
【问题描述】:
我正在尝试将我的 api 值放入 q-select 中,但它显示所有值的 [object Object]
<q-select
v-model="product_brand"
:options="brands"
label="Product Brand *"
lazy-rules
:rules="[ val => val && val.length > 0 || 'Please select product brand']"
/>
这是获取 api 值的脚本代码
export default () {
data () {
return {
brands: []
}
},
created () {
this.$axios.get(['http://127.0.0.1:8000/api/lailen-inventory/categories'])
.then(res => {
this.brands = res.data.categories
})
.catch(errors => {
console.log(errors)
})
},
}
【问题讨论】:
标签: javascript vue.js axios quasar-framework quasar