Vue.Js REQUEST Http Get Method Api

Vue.Js REQUEST Http Get Method  Api

<script>
    new Vue({
     el: '#products',
     data: {
         //debug: true,
         chk: '',
         products: []
     },
     ready: function() {
         this.$http.get('http://188.166.172.244/api/v1/orders', function(data,
             status, request) {
             //alert("data"+data);
             this.products = data;
         }).error(function(data) {
             this.chk = true;
         });
     },
     //Export button click
     methods: {
         greet: function(event) {
             // `this` inside methods point to the Vue instance
             var today = new Date();
             var dd = today.getDate();
             var mm = today.getMonth() + 1; //January is 0!
             var yyyy = today.getFullYear();
             if (dd < 10) {
                 dd = '0' + dd
             }
             if (mm < 10) {
                 mm = '0' + mm
             }
             var today = dd + '/' + mm + '/' + yyyy;
             JSONToCSVConvertor(this.products, "Report_" + today, true);
         }
     }
 });
            
</script>
Share on Google Plus

About quora Questions & Answers A-Z

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment