-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
v-memo doesn't work with v-for #4246
Comments
What are you actually trying to achieve? Why would you use something that isn't used in the v-for in the |
I don't use it in my project (yet) I was just testing this feature in the playground and noticed it doesn't work with v-for, that's it. Other example. Shouldn't it always render count: 0 within the list? basically act like v-once? <div v-for="id in 3" :key="id" v-memo="[true]">
count: {{ count }}
</div> |
I don't think v-memo is supposed to work like v-once. Since you are passing |
from the docs:
in my example memo value doesn't change ( |
you added I'm also confused, this seems like a bug |
this seem to be a problem with iterating over a number v-for="(id, index) in 3" if you iterate over array the v-memo seem to work v-for="(id, index) in items" when the iterator type is Number , it does not pass cache to render function, so the v-memo cache logic is skipped |
oh good catch 😂 |
some what related issue #4253 |
Version
3.2.0-beta.7
Reproduction link
Vue SFC Playground
Steps to reproduce
click inc button
What is expected?
<Item />
should not re-render unless value of count is greater than 4, similar to div aboveWhat is actually happening?
v-memo with v-for doesn't work at all and
<Item />
re-renders each time count value is incremented.The text was updated successfully, but these errors were encountered: