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')
			},
		}
}
相关推荐
遗憾随她而去.1 小时前
uniapp 折叠动画 <transition> 踩坑记录
css·uni-app
百锦再7 小时前
Elements Plus 跨设备自适应显示问题综合解决方案
python·flutter·小程序·uni-app·k8s·tornado·net
坚持学习前端日记10 小时前
UniApp APK打包与Android深度集成能力解析
android·vue.js·uni-app
wetyuo1 天前
【随手记】uniapp + V3 使用TailwindCss3
uni-app·vue·css3·vite
小恒恒3 天前
2025 Vibe Coding 有感
前端·uni-app·trae
一颗小青松3 天前
uniapp使用uni-im
uni-app
2501_916007473 天前
iPhone APP 性能测试怎么做,除了Instruments还有什么工具?
android·ios·小程序·https·uni-app·iphone·webview
2501_915106323 天前
Windows 环境下有哪些可用的 iOS 上架工具, iOS 上架工具的使用方式
android·ios·小程序·https·uni-app·iphone·webview
一颗小青松3 天前
uniapp vue3中app端使用腾讯云点播上传
uni-app·云计算·腾讯云
玄尺_0073 天前
uniapp h5端使浏览器弹出下载框
前端·javascript·uni-app