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')
			},
		}
}
相关推荐
吴传逞14 小时前
记一次uniapp微信小程序开发scss变量失效的问题
微信小程序·uni-app·scss
2501_915921431 天前
小团队如何高效完成 uni-app iOS 上架,从分工到工具组合的实战经验
android·ios·小程序·uni-app·cocoa·iphone·webview
2501_916008891 天前
uni-app iOS 文件管理与 itools 配合实战,多工具协作的完整流程
android·ios·小程序·https·uni-app·iphone·webview
!win !1 天前
uni-app项目Tabbar实现切换icon动效
小程序·uni-app
xw51 天前
uni-app项目Tabbar实现切换icon动效
前端·uni-app
2501_916007471 天前
uni-app iOS 文件调试常见问题与解决方案:结合 itools、克魔、iMazing 的实战经验
android·ios·小程序·https·uni-app·iphone·webview
豆豆(设计前端)1 天前
使用 Uni-app 打包 外链地址APK 及 iOS 注意事项
ios·uni-app
jingling5551 天前
uniapp | 解决组件样式不生效问题
前端·css·uni-app·html·学习方法
^Rocky1 天前
微信小程序(uniapp)实现连接蓝牙
微信小程序·uni-app·蓝牙连接
2501_915918411 天前
uni-app 项目 iOS 上架踩坑经验总结 从证书到审核的避坑指南
android·ios·小程序·https·uni-app·iphone·webview