We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09b570e commit c6bccaeCopy full SHA for c6bccae
README.md
@@ -270,6 +270,7 @@
270
- [字符串形式的ref](./react/字符串形式的ref.md)
271
- [Update和UpdateQueue](./react/Update和UpdateQueue.md)
272
- [react脚手架](./react/react脚手架.md)
273
+- [消息订阅与发布](./react/消息订阅与发布.md)
274
275
## 常见问题及解答
276
react/消息订阅与发布.md
@@ -0,0 +1,12 @@
1
+消息订阅-发布机制
2
+
3
+工具库:PubSubJS
4
5
+下载:npm install pubsub-js --save
6
7
+使用:
8
9
+1. import PubSub from 'pubsub-js' // 引入
10
+2. PubSub.subscribe('delete', function(data){}); // 订阅
11
+3. PubSub.publish('delete', data) // 发布消息
12
0 commit comments