The global variables that complete the assignment in the cretaed hook function cannot be obtained in the hook function mounted. All the global variables returned are undefined.

The

hook function mounted cannot get the global variables that complete the assignment in the cretaed hook function, and all undefined, are returned. What is the reason?

Mar.19,2021

you don't initialize directly in created, but do it asynchronously in getCoachDetails, so this order is not correct. In mounted, the asynchronous initialization hasn't been performed yet, so it's still undefined.

Menu