vue2 子组件依赖this.$emit透传 vue3 方法一setup(props, context) 没有办法使用this 运行结果: attrs:值为对象,组件外部非响应式传递过来、emit:触发事件 、slots:插槽 vue3 方法二 <script setup> 官方文档 截图如下