PubSubJS is a topic-based publish/subscribe library written in JavaScript.即 一個利用JavaScript進行發佈/訂閱的庫git
github: https://github.com/mroderick/...
npm: https://www.npmjs.com/package...github
綁定事件監聽 === 訂閱消息
觸發事件 ====發佈消息npm
發送消息:PubSub.publish(名稱,參數)
訂閱消息:PubSub.subscrib(名稱,函數)
取消訂閱:PubSub.unsubscrib(名稱)函數
我這裏用於Vue中兄弟組件的傳值spa
發佈消息(觸發)3d
訂閱消息(事件監聽)
加粗文字
blog