Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新v-model绑定的数据,内部$nextTick回调函数没有调用 #185

Open
c-sopoo opened this issue Jan 22, 2025 · 0 comments
Open
Labels
question Further information is requested

Comments

@c-sopoo
Copy link

c-sopoo commented Jan 22, 2025

** 请描述您在使用期间遇到的疑问 **
hbuilderX:4.45,微信小程序

我的业务场景:使用虚拟列表滚动分页,需要从接口轮询更新排序
具体操作:v-model绑定数据,通过轮询,修改了v-model绑定的数据后,看源码会触发updateVirtualListRender方法,但内部的nextTick回调没有被调用,是uni-app的bug?理应是每次都会被调用的吧

初步猜测是uni-app的bug,

简单实现,修改示例代码virtual-list-no-inner-demo.vue

Image
添加如下方法:

update() {
	setTimeout(() => {
		console.log('更新了')
		this.totalData = [...this.totalData]
		this.update()
	}, 5000)
}

简单调用:

Image
添加日志:

Image

微信小程序实际表现:😦???nextTick回调怎么没有被调用

Image

H5表现:

Image

@c-sopoo c-sopoo added the question Further information is requested label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant