其他分享
首页 > 其他分享> > vue在子组件向父组件emit时,父组件会警告;

vue在子组件向父组件emit时,父组件会警告;

作者:互联网

 

 Extraneous non-emits event listeners (swiperimageload) 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. 

 

需要在子组件声明emits:

emits: ["swiperimageload"],

参考:https://stackoverflow.com/questions/64220737/vue-3-emit-warning-extraneous-non-emits-event-listeners 

标签:non,vue,向父,在子,component,emits,组件,event
来源: https://www.cnblogs.com/BillBie/p/16268899.html