Uniapp小程序MBG 开发踩坑日记

最近开发一套微信音乐小程序框架使用vue3,但还是要吐槽一下,有时候会突然报错,怎么也调试不好,过段时间自己又好了,这让开发者体验极差。下面说下遇到的一些问题

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

如果使用vue2 子组件的暴露给父组件的写法会报这个警告。需要在vue3的写法,在emits中提前声明。

javascript 复制代码
//vue2
this.$emit('close')

//修改
export default {
		name: 'popup',
		emits: ['close'],
        methods: {
			close() {
				this.$emit('close')
			},
		}
}
相关推荐
spmcor6 小时前
身份证读卡“无感登录”方案实践:从手动点击到自动检测
uni-app
PedroQue9912 小时前
uni-router v1.8.0新增冷启动守卫补执行
前端·uni-app
PedroQue992 天前
uni-router v1.7.0重磅更新:守卫重定向自由掌控
前端·uni-app
一份执念3 天前
uni-app项目 (vue+vite + uni-UI)中引入umd格式JS文件,微信小程序中导入报错处理方案
前端·uni-app·echarts
PedroQue993 天前
V1.6.1性能优化:高频路径提速与代码精简
前端·uni-app
夏碧笔6 天前
uni-app跨端地图实战:用第三方LBS替代微信平台收费服务
uni-app
用户69903048487510 天前
try catch使用场景 处理同步代码错误兼容用的
javascript·uni-app
ITKEY_10 天前
uniapp微信开发者工具 更改AppID失败 touristappid
uni-app
Geek_Vison11 天前
APP瘦身实战:从80MB+砍到15MB——基于小程序容器技术剥离APP非核心业务的实践分享
小程序·uni-app·mpaas
CHB11 天前
HDC2026 演讲实录|AI 驱动的跨端进化:利用 uni-agent 快速构建高性能鸿蒙应用
uni-app·harmonyos