From 45e9700d1a30f47c5e741088dcfcbab469c863df Mon Sep 17 00:00:00 2001 From: Creuzdos Date: Sun, 8 Mar 2020 15:34:45 +0000 Subject: [PATCH] Upload files to 'js' --- js/vueApp.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 js/vueApp.js diff --git a/js/vueApp.js b/js/vueApp.js new file mode 100644 index 0000000..3894f76 --- /dev/null +++ b/js/vueApp.js @@ -0,0 +1,22 @@ +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; */ + + } + } + } +);