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开发pc端,小程序和APK
小程序·uni-app
2501_915918412 天前
iOS性能测试工具 Instruments、Keymob的使用方法 不局限 FPS
android·ios·小程序·https·uni-app·iphone·webview
2501_915918412 天前
iOS 混淆流程 提升 IPA 分析难度 实现 IPA 深度加固
android·ios·小程序·https·uni-app·iphone·webview
前端 贾公子2 天前
解决uni-app 输入框,键盘弹起时页面整体上移问题
前端·vue.js·uni-app
Muchen灬2 天前
【uniapp】(5) 创建gitee仓库并推送源码
gitee·uni-app
Muchen灬2 天前
【uniapp】(6) uniapp中使用vuex
uni-app
2501_915909062 天前
React Native 上架 App Store:项目运行与审核构建的流程
android·ios·小程序·https·uni-app·iphone·webview
李庆政3702 天前
uniapp+unicloud打包部署微信小程序
微信小程序·小程序·uni-app
2501_915909062 天前
苹果 Safari 浏览器抓包 页面刷新后的请求分析
android·前端·ios·小程序·uni-app·iphone·safari