-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Value inside v-slot in a v-for won't update #9506
Closed
jedrula opened this issue
Feb 16, 2019
· 0 comments
· Fixed by mariazevedo88/hash-generator-js#6, tghelere/valorize-vidas#3, tghelere/DeliVuery#15, tghelere/vue-tetris#1 or tghelere/dailymages#1
Closed
Value inside v-slot in a v-for won't update #9506
jedrula opened this issue
Feb 16, 2019
· 0 comments
· Fixed by mariazevedo88/hash-generator-js#6, tghelere/valorize-vidas#3, tghelere/DeliVuery#15, tghelere/vue-tetris#1 or tghelere/dailymages#1
Labels
Comments
This was referenced Aug 29, 2019
This was referenced Sep 22, 2019
Lostlover
pushed a commit
to Lostlover/vue
that referenced
this issue
Dec 10, 2019
This was referenced Jan 20, 2020
This was referenced Feb 24, 2020
This was referenced Mar 4, 2020
This was referenced Apr 15, 2020
This was referenced May 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
2.6.0
Reproduction link
https://github.com/jedrula/slot-updates-on-vue-2.6
jsfiddle: http://jsfiddle.net/sj8wcx0k/
Steps to reproduce
You can see the problem on a deployed version of https://github.com/jedrula/slot-updates-on-vue-2.6 here: http://slot-updates-vue-26.surge.sh/
You run into a problem like that if
What is expected?
Rendered item in v-for should behave in a same way as rendered item in v-for inside a v-slot - it should be re-rendered when the whole array driving the v-for changes.
I'd expect no changes in behavior from Vue 2.5.22. You can see how it behaves on the same code with
vue 2.5.22
. I have deployed same code with downgraded Vue version here: http://slot-updates-vue-25.surge.sh/What is actually happening?
The item inside v-for in a v-slot is not re-rendered:
https://github.com/jedrula/slot-updates-on-vue-2.6/blob/master/src/App.vue#L6
I know that the issue can be resolved by providing proper v-key to the v-for. The confusing part though is that the even without the v-key this line is updated: https://github.com/jedrula/slot-updates-on-vue-2.6/blob/master/src/App.vue#L4 but this line is not: https://github.com/jedrula/slot-updates-on-vue-2.6/blob/master/src/App.vue#L6.
If that's not a bug but something I don't understand about scoped slots it might be good to add some information about that in some Vue reactivity gotchas ? I wonder why it bit me given a change from 2.5 -> 2.6 should not be breaking.
The text was updated successfully, but these errors were encountered: