Comments (4)
msgCount 的逻辑是我的消息数目,MessageList 是我的消息列表,消息列表中有一个已读操作,点击已读,消息数目会减1,为了能够实现这个效果,我进行了状态提升,将我的消息数目的逻辑提升到了App组件中。 @crossjs
from my-cnode.
如果不进行状态提升,还有什么办法呀 @crossjs
from my-cnode.
有必要的话把内部动作向上传递,由父容器做两个组件通信的桥梁。
耦合是难免的,但我们要尽量做到弱耦合,尽量只暴露必要的接口与数据给外部。
from my-cnode.
嗯嗯
from my-cnode.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from my-cnode.