var vm = new Vue({
el: '#vue-table',
data: {
groups: []
},
methods: {
getData: function (){
axios.get('/web/api/groups/get.php')
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});
}
},
created: function () {
this.getData();
}
});
methods: {
getData: function (){
let vm = this;
axios.get('/web/api/groups/get.php')
.then(function (response) {
vm.groups // твои data.groups
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});
}
},