Scene: the method vuex need to wait for the other event trigger, such that the value haveGroupList later changed to true, you can perform the following after the code
Promise wording:
getData(){ let r = new Promise((resolve) =>{ let timer = setInterval(() =>{ if(this.haveGroupList === true){ clearInterval(timer) resolve(true) } },100) }) r.then((res) =>{ console.log('ddddddddddddddo somting') ... }) }
async / await wording:
async getData(){ await new Promise( (resolve) =>{ let timer = setInterval(() =>{ if(this.haveGroupList === true){ clearInterval(timer) resolve(true) } },100) }) console.log('ddddddddddddddo somting') ... }