wrote a function to return data,
Vue.prototype.$http = axios
Vue.prototype.getData = function(url){
let _data ="";
this.$http.get(url).then(res=>{
_data = res.data;
});
return _data;
}
if you can"t get the data in this way, the returned data is still empty. I don"t know how to solve it, or if there is any way to set up Synchronize on axios.
I want to get the data directly like this
this.list = this.getData (url);
Whenor data, the data is returned directly
data:function () {
return this.getData(url);
}