methods: {
ShowWindow: function(QueryID) {
this.$data.ID = QueryID;
if(this.GetData())
{
console.log("asdasd")
}
document.querySelector("#EditWindow").style.visibility = "visible";
console.log(this.$data.RowData.name + "asdd");
this.$refs.Title.SetName(this.$data.RowData.name + " " + this.$data.ID);
},
GetData: function(){
const URI = localStorage.getItem("URI") + *URL part 2* + this.$data.ID;
axios.get(URI, this.$parent.$data.optionsAxios).then((result) =>{
this.$data.RowData = result.data;
//console.log(result.data);
console.log(this.$data.RowData.name);
}).catch(err =>{
console.log(err);
})
return true;
}
},
mounted(){
this.$data.ID = this.$route.params.UserID;
this.ShowWindow(this.$data.ID);
this.$data.TableName = this.$parent.TableName;
}
I can't figure out why the sequence of console.log() outputs is as it is.
Initially, I receive output from this:
console.log("asdasd");
followed by
console.log(this.$data.RowData.name + "asdd");
and finally
console.log(this.$data.RowData.name);
I'm puzzled as to why it skips over what's inside this.GetData() and shows this last.