Skip to content

Correct small bugs in the v-for array refs examples #771

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

Merged
merged 1 commit into from
Jan 2, 2021

Conversation

skirtles-code
Copy link
Contributor

I've fixed 3 problems with these examples.

  1. ref is unused, close ref is unused in array example #766.
  2. The setItemRef function needs an if check, otherwise removed nodes will be pushed as null. This is effectively the same problem I reported in Composition API template refs with v-for example - update problem #353, though in a different part of the docs.
  3. The setup function should not return itemRefs, it's highly misleading. itemRefs is reassigned in onBeforeUpdate but that won't update the value returned from setup. There are other ways to fix this (set the length to 0 or wrap it in a ref) but this seemed the simplest.

@NataliaTepluhina NataliaTepluhina merged commit 24c809e into vuejs:master Jan 2, 2021
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

Successfully merging this pull request may close these issues.

ref is unused in array example
2 participants