Soundbox/js/vueApp.js
2020-03-08 15:34:45 +00:00

23 lines
516 B
JavaScript

new Vue(
{
el: "#app",
data: {
listeDeSons:null
},
created: function(){
this.loadData();
},
methods: {
loadData: function() {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", '/Sounds', false ); // false for synchronous request
xmlHttp.send( null );
this.listeDeSons = JSON.parse(xmlHttp.responseText);
/*this.$http.get('/Sounds').then(function(response){
this.listeDeSons = response.body; */
}
}
}
);