Some Perplexity of component message passing in vue

1. I abstracted the problems I encountered, as shown in the figure

. I describe the relationship between

components as a tree.
I have an input box on the root component. I now want to push the contents of the input box to the list of component 3 when pressing enter, and the counter num PP; of component 2 asks how to do this.

that is to say, how to design components and the relationship between components is more elegant

Mar.03,2021

vuex learn about


vuex should be able to solve your problem


vuex is the solution to the problem of multi-component state sharing

Menu