problem description
before visiting a page, Promise is used in beforeRouteEnter to obtain some API data, and then next () calls back vm assignment. The problem now is that after entering the page normally, the next callback is not triggered, and it will only be triggered after refreshing the page again. What is the cause of this problem.
the environmental background of the problems and what methods you have tried
I tried. There is no problem with next () outside promise. It can print normally. Is it promise"s problem? If that"s why it doesn"t work the first time, just refresh the page again. Or did the refresh cause beforeRouteEnter to be triggered again?
related codes
/ / Please paste the code text below (do not replace the code with pictures)
Promise.all (["getALLData"]). Then ((values) = > {
next(vm=>{
console.log("next")
vm.createWS()
})
})