JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.3/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<div id="app">
{{message}}
</div>
</body>
JavaScript
new Vue({
el: "#app",
data: {
message: [1,2,3,]
},
methods: {
getList: function () {
var myGet = axios.get('/api/guests/.json')
.then( response => {
this.message = response.data;
})
.catch( error => {
this.message = 'Error';
console.log(error);
});
}
},
created:function () {
this.getList();
}
});