I am trying to put my api value into q-select but it is showing [object Object]
for all the values
<q-select
v-model="product_brand"
:options="brands"
label="Product Brand *"
lazy-rules
:rules="[ val => val && val.length > 0 || 'Please select product brand']"
/>
Here is the script code for taking the api values
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)
})
},
}
for example if brands array is like
if you just want to collect value instead of object use emit-value and map-option props and your code will be like below: