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

互联网 2022/5/14 6:26:55

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, d…

 

 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 

随时随地学软件编程-关注百度小程序和微信小程序
关于找一找教程网

本站文章仅代表作者观点,不代表本站立场,所有文章非营利性免费分享。
本站提供了软件编程、网站开发技术、服务器运维、人工智能等等IT技术文章,希望广大程序员努力学习,让我们用科技改变世界。
[vue在子组件向父组件emit时,父组件会警告;]http://www.zyiz.net/tech/detail-320834.html

赞(0)
关注微信小程序
程序员编程王-随时随地学编程

扫描二维码或查找【程序员编程王】

可以随时随地学编程啦!

技术文章导航 更多>