vue3警告Extraneous non-emits event listeners (XXX) were passed to component but could not be automatic
vue3 警告Extraneous non-emits event listeners (selectMeth) 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 选项。
第一种,setup之外:
export default {//提前声明你要使用的自定义事件emits: ['modelValue'],......mounted(){this.$emit('modelValue','hello world')},setup(){......}
}
第二种,setup之内:
<script setup>//提前声明你要使用的自定义事件const emit = defineEmits(['modelValue'])emit('modelValue', 'hello world')
</script>
vue3警告Extraneous non-emits event listeners (XXX) were passed to component but could not be automatic相关推荐
- [vue]Extraneous non-emits event listeners (x) were passed to component but could not be automatica
vue报错说: [Vue warn]: Extraneous non-emits event listeners (addToCart) were passed to component but co ...
- Vue3报错:Extraneous non-props attributes (ref_key) were passed to component but could not be automatic
Vue3报错:Extraneous non-props attributes (ref_key) were passed to component but could not be automatic ...
- Passive Event Listeners
vue3中写项目时,Chrome提示以下信息: [Violation] Added non-passive event listener to a scroll-blocking 'wheel' ev ...
- #C语言#警告:隐式声明函数‘xxx’ [-Wimplicit-function-declaration]
推荐阅读:C语言实现2048小游戏-粤嵌GE6818嵌入式系统实训 C语言编译时报错: 警告:隐式声明函数'xxx' [-Wimplicit-function-declaration] 加下对应函数的 ...
- Vue nvm重装node和npm与vue3报错Emitted ‘error‘ event on ChildProcess instance at errno: -4058
Vue nvm重装node和npm与vue3报错Emitted 'error' event on ChildProcess instance at errno: -4058 昨天运行的项目,一直报错, ...
- 让页面滑动流畅得飞起的新特性:Passive Event Listeners
声明:本文来自腾讯增值产品部官方公众号小时光茶社,为CSDN原创投稿,未经许可,禁止任何形式的转载. 作者:陈志兴,腾讯高级工程师,11年毕业后加入腾讯,期间主要负责过QQ文件传输质量优化.本地文件共 ...
- vue3.x 自定义事件 emits
相比于 vue 2.x ,在自定义事件时 vue 3.x 提供一个 emits 选项,和现有的 props 选项类似.这个选项可以用来定义一个组件可以向其父组件触发的事件.参考 >> 官方 ...
- ssh mysql 警告_SSH连接MySQL 出现Table 'xxx' doesn't exist
SSH连接MySQL 出现Table 'xxx' doesn't exist 在applicationContext.xml中的配置 com.mysql.jdbc.Driver jdbc:mysql: ...
- 警告 C6011 取消对NULL指针XXX的引用
若要更正此警告,请检查指针是否有 null 值 #include <malloc.h> void f( ) {char *p = ( char * )malloc ( 10 );if ( ...
- 解决AD原理图编译警告(Off grid Net Label xxx at xxx )
问题描述: AD编译原理图,警告如下: 解决办法 1.双击对话框中对应的Message,跳转到出现警告的网络处 2.选中网络,然后右击选择Align--Align To Grid即可 3.重新编译即可 ...
最新文章
- 【Ant Design Pro 二】 创建页面,组件,并在页面调用
- 7 天玩转 ASP.NET MVC — 第 6 天
- 把握linux内核设计思想(十二):内存管理之slab分配器
- 清理localstorage_vue 界面刷新数据被清除 localStorage的使用详解
- html:(7):了解hx标签和加强语气
- 微塔式服务器esxi虚拟机黑群晖,ESXi6主机上安装部署黑群晖虚拟机
- wincc 如何实现上下箭头对数字的增减_由箭头函数引发的对一些概念的认识
- iframe去边框,无边框。使用大全
- 敏捷开发(scrum)简介
- wangEditor上传不了图片
- 阿里云 MaxCompute Tunnel Upload 上传典型问题整理
- 软件测试工程师必备技能(初中高)
- The APR based Apache Tomcat Native library which allows optimal performance in production 问题的解决
- python openpyxl怎么将数组写入excel_Python-使用openpyxl模块写入Excel文件
- 【自动驾驶感知领域目前研究热点】
- 网络攻防技术-Lab5-shellcode编写实验(SEED Labs – Shellcode Development Lab)
- 用mobx-react框架wukong撸个电影网站
- 铁路 信号组调工 技师 练习题 01
- CSS篇-dbMovies和dbBooks小网页
- 北京互联网创业者比上海广州加起来还多!(多图)
热门文章
- IIS 7无法写入配置文件C:\Windows\System32\inetsrv\config\applicationHost.config
- python把文件转化为二进制流-python:将一个文件转换为二进制文件(binary)
- C语言用数组模拟实现栈(LIFO)
- 漫画:用木兰从军说外观模式
- 带农历和法定节假日的 日历控件_带节日和农历的js日历
- python统计人物出现次数_python实例:利用jieba库,分析统计金庸名著《倚天屠龙记》中人物名出现次数并排序...
- oracle remote diagnostic agent,Oracle数据库收集、分析工具RDA(RemoteDiagnostic Agent)下载
- pdf会签_图纸会签规定
- 很好的东子(干货很多)--把一个函数变成全局的方法及slideToggle()
- 五分钟入门 Dingo API 1