Answer the question
In order to leave comments, you need to log in
Why does the VUE.js component not see properties?
Why doesn't the component see the product properties?
Vue.component('catalog-content-wrap', {
template: '#catalog-content-wrap',
data : function () {
return{
products : [],
filters : [],
message : 'hello'
}
},
mounted () {
this.get_catalog_content();
},
methods : {
get_catalog_content : function () {
this.loader = true;
this.$http.post( Website.href ).then(response => {
this.products = response.body.products;
console.log( response.body.products )
} );
}
}
})
<script type="text/x-template" id="catalog-content-wrap">
<div class="row no-margin catalog-content-wrap" id="catalog-content-wrap" >
<div class="col-md-4 col-sm-4 col-xs-6 mob-product" v-for="product in products">
{{product}}
</div>
</div>
</script>
Answer the question
In order to leave comments, you need to log in
this.$http.post( Website.href ).then(response => {
this.products = response.body.products;
console.log( response.body.products )
} );
this.$http.post( Website.href ).then(response => {
this.products = response.body.products;
console.log( response.body.products )
},response => {
console.error(response)
}
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question