Skip to content

VUE:for循环双层嵌套或插槽嵌套,内部子组件打印数据时,总是显示最后一个 #235

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

Open
smileyby opened this issue Mar 17, 2022 · 1 comment
Labels

Comments

@smileyby
Copy link
Owner

有点像 for循环结束后,非闭包情况下,值总是最后一个样,待解决和测试

@smileyby smileyby added the Todo 🐦 Todo label Mar 17, 2022
@smileyby
Copy link
Owner Author

背景回顾:

  1. 组组件 created 中,给window绑定 testMethod 方法
  2. 在组件循环完毕之后,window上绑定的 testMethod 方法被最后一个 子组件中的 testMethod 方法覆盖
  3. 所以 在触发 testMethod 打印数据的时候,总是显示循环最后一条的数据

@smileyby smileyby added VUE 🌌 and removed Todo 🐦 Todo labels Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant