Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问,有木有跨级多层组件的通讯,props传递的方案呀 #55

Open
clevok opened this issue Jul 31, 2019 · 2 comments
Open

Comments

@clevok
Copy link

clevok commented Jul 31, 2019

场景如下,有个搜索组件,搜索组件用 input 组件,
想的是input的事件冒到一个 panel组件,pannel往搜索组件传入几个props,部分props往input下发过去,
现在主要是中间搜索组件做转发,感觉好蛋疼呀,要写好多,如果再跨一层。。。

@switer
Copy link
Member

switer commented Jul 31, 2019

  1. 通过页面内的消息模块来做广播实现跨层通信
  2. 引入redux之类的状态管理模块

@clevok
Copy link
Author

clevok commented Aug 1, 2019

好的谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants