Vue3 declare it using the "emits" option警告
Vue3已将父子组件传值修改为defineEmits函数,但是在日常使用时有时会报错:[Vue warn]: Extraneous non-emits event listeners (update) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.
通过警告信息可以得出Vue需要我们将emits中的传参事件标明:
这样修改,将需要用到的事件在定义时传在函数就可以了