new Vue({ el: '#app', data: { title: 'HACKING GAME', yourLevel: 0, levels: 0, infor: '', rLevel: '' }, mounted() { this.getData(); console.log(this.rLevel); }, methods: { getData: function() { axios.get('app/Controllers/PostController.php', { params: { action: 'getData' } }) .then((response) => { this.yourLevel = response.data.level; }) .catch((error) => { console.log(error); }) } } });