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

vue中&nextTick的原理 #1237

Open
free-lxc opened this issue Oct 4, 2023 · 1 comment
Open

vue中&nextTick的原理 #1237

free-lxc opened this issue Oct 4, 2023 · 1 comment

Comments

@free-lxc
Copy link

free-lxc commented Oct 4, 2023

对于vue中的生命周期nextTick一直是个特殊的存在,只有在特定的时候才会发挥作用,那么他的作用是什么以及原理?

@kd-cell
Copy link

kd-cell commented Dec 25, 2024

他的主要作用是确保DOM元素已经更新到最新后再去执行回调函数,这样在回调函数中获取到的DOM元素是最新的DOM元素,避免获取到旧的元素或数据

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants