diff --git a/package-lock.json b/package-lock.json index 0d4e8de..18c5e2e 100644 --- a/package-lock.json +++ b/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", diff --git a/package.json b/package.json index 8f4a7a9..e08f76c 100644 --- a/package.json +++ b/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", diff --git a/src/utils/eventBus.js b/src/utils/eventBus.js new file mode 100644 index 0000000..a11145c --- /dev/null +++ b/src/utils/eventBus.js @@ -0,0 +1,6 @@ +/** + * 事件总线(用于跨组件通信,一般用于非父子组件) + */ +import mitt from 'mitt'; + +export default mitt();