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: this.$nextTick() #45

Open
leslie1943 opened this issue Nov 23, 2020 · 0 comments
Open

Vue: this.$nextTick() #45

leslie1943 opened this issue Nov 23, 2020 · 0 comments

Comments

@leslie1943
Copy link
Owner

this.$nextTick()

  • 在下次DOM更新循环结束之后执行延迟回调,在修改数据之后立即使用这个方法,获取更新后的DOM. 有些时候在改变数据后要立即对dom进行操作,此时获取到的dom仍然是数据刷新前的dom,这个时候需要用 $nextTick
  • 应用场景如: 获取dom某个ref的文本, 清空一些弹窗校验, 给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

1 participant