1安装 npm install --save mitt
2 新建一个js文件
import mitt from "mitt";
const $mitt = mitt()
export default $mitt
3 父组件
<script setup>
import appCHILD1 from './appChild1.vue'
import appCHILD2 from './appChild2.vue'
</script>
<template>
<h1>npm install --save mitt</h1>
<h1>import mitt from 'mitt'</h1>
<h1>var mitt = require('mitt')</h1>
<appCHILD1></appCHILD1>
<appCHILD2></appCHILD2>
</template>
<style scoped></style>
4 子组件1
<script setup>
import { ref } from 'vue'
import $bus from './bus/index'
let money = ref(10000)
const cl