[Vuejs]-Show result from json with axios

0๐Ÿ‘

โœ…

If I understand correctly, doing this should work:

new Vue({
  el: "#app",

  data() {
      statsCards: []
  },
  mounted() {
    axios.get("http://localhost:3000/statcard").then(response => {
      this.statsCards.push({
        type: "warning",
        icon: "ti-server",
        title: "Cases",
        value: response.data.total_orders,
        footerText: "Updated now",
        footerIcon: "ti-reload"
      });
    });
  }
});

Leave a comment