We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
更新Dom函数和nextTick的回调函数都在microtask队列里,而microtask队列只会在所有同步任务都执行完后才会执行,这样就保证了,Dom更新和nextTick的回调函数一定在数据更新后,而callbacks数组里的顺序保证了nextTick的回调函数一定在Dom更新后(特别提醒:Dom更新是同步的,ui渲染才是异步的)。
The text was updated successfully, but these errors were encountered:
用MutationObserver只是因为他的microtask特性,在源码中我们也看到了假如不支持MutationObserver,还有setImmediate等选择,最后实在不行只能用setTimeOut(setTimeOut只有Macrotasks特性,没办法才用他 )。其实假如有更好的选择,MutationObserver也会被换掉,实际上在Vue2.5.x以后,MutationObserver也确实因为某些兼容问题被去掉了。
Sorry, something went wrong.
No branches or pull requests
更新Dom函数和nextTick的回调函数都在microtask队列里,而microtask队列只会在所有同步任务都执行完后才会执行,这样就保证了,Dom更新和nextTick的回调函数一定在数据更新后,而callbacks数组里的顺序保证了nextTick的回调函数一定在Dom更新后(特别提醒:Dom更新是同步的,ui渲染才是异步的)。
The text was updated successfully, but these errors were encountered: