[Vuejs]-How to show data in a VueJS app through request?

3👍

this in then block is not Vue instance. You can use arrow function

mounted: function() {
  get('http://www.mocky.io/v2/5c7fd404330000c6378483fe')
  .then((response) => {
    this.slides = response.ATTslides
    this.producttitle = response.ATTproducttitle

  }).catch(function(){
    console.log('error')
  });
}
👤ittus

Leave a comment