Browse Source

【集成】mitt事件总线

master
xiaosi 1 year ago
parent
commit
2ebf05b70f
  1. 1
      package-lock.json
  2. 1
      package.json
  3. 6
      src/utils/eventBus.js

1
package-lock.json

@ -11,6 +11,7 @@
"axios": "^1.6.2",
"jwt-decode": "^4.0.0",
"less": "^4.2.0",
"mitt": "^3.0.1",
"pinia": "^2.1.7",
"tdesign-vue-next": "^1.7.0",
"vue": "^3.3.4",

1
package.json

@ -13,6 +13,7 @@
"axios": "^1.6.2",
"jwt-decode": "^4.0.0",
"less": "^4.2.0",
"mitt": "^3.0.1",
"pinia": "^2.1.7",
"tdesign-vue-next": "^1.7.0",
"vue": "^3.3.4",

6
src/utils/eventBus.js

@ -0,0 +1,6 @@
/**
* 事件总线用于跨组件通信一般用于非父子组件
*/
import mitt from 'mitt';
export default mitt();
Loading…
Cancel
Save