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);
}
}
});
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>
0 comments:
Post a Comment