Vue Controller (menu? ) how to build it reasonably?

at present, there are components An and B for view and B for control. Due to layout reasons, AB is far away (communication requires several components)

B has a default value isDo = false
A that needs to perform certain actions based on isDo.

there is no dependency between An and B (if isDo does not count). Currently, bridging (C) is used to communicate. Since the timing of AB loading is uncertain,
for example, when I pass isDo to C when I B beforeCreate , it is very likely that A has been created , and A cannot find the isDo (B in C and has not been assigned yet. On the contrary, it is also possible that B is completed.

excuse me, how can I make sure that B will get isDo?

Apr.11,2021

introduce vuex
depending on your situation, you introduce a third component for component communication, which is messy and wrong

.
Menu