Iam new in vuejs. So I have this array in my data and when I output the data in console the result is correct. I need to put the categories in an array because it can have multiple categories.
const app = new Vue({
el:"#app",
data:{
market:{
categories:[]
}
},
methods: {
init: function(){
var app = this;
var url = '/api/categories/0';
axios.get(url).then(function(response){
app.market.categories[0] = response.data;
console.log(app.market.categories[0]);
});
}
}
});
But when use v-for in the ui it doesn't show. Can you help? Thanks`
<select class="form-control form-control-no-border" id="s-category1">
<option value="">Please select a category</option>
<option v-for="category in market.categories[0]" :value="category.external_code">@{{ category.name }}</option>
</select>