vue3uniapp子组件触发父组件function uni.$emit() uni.$on()

父组件

uni.$on('update', function (data) {
	console.log('监听到事件来自 update ,携带参数 msg 为:' + data.msg);
	getListdata(resData.value);
})

子组件

function click(){
      uni.$emit('update', { msg: '页面更新' })
}
posted @ 2025-03-12 09:30  格林格林  阅读(72)  评论(0)    收藏  举报