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

v-memo doesn't work with v-if #6593

Closed
ruizhen opened this issue Sep 4, 2022 · 1 comment · Fixed by #6606
Closed

v-memo doesn't work with v-if #6593

ruizhen opened this issue Sep 4, 2022 · 1 comment · Fixed by #6606
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working

Comments

@ruizhen
Copy link

ruizhen commented Sep 4, 2022

Vue version

3.2.38

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9UEtuwjAQvcrUG4ogcVU2FQ0RPUfdRTATkoI/sp2wiHL3jpMU0VRiN+/N+4ymYx/Wpm2DbMsyL11tA3gMjc2FrpU1LkAHDkvooXRGwYKki3ehhZZGe9JW5gq7qHgOrsHlLy9No8O0eFmSIeNjOuUSCKjspQhICCDzttDQJnW5EywGCkZIoTKEP4ekL8HyrhvGvqcoMuQweA9NCEbDXl5qeZ781Ps05uSyKvQJhzMzPmrHzrlvyF6tomWcbnLqyfjtYLZm418SVdj02xtNn+tipJgWXrAtDEzk6F8RC1aFYP2W80bb8ymVRvE97bijslphcjRqv0lf080bP9Y+3PMpepUcnLl6dNQo2PounBPZoksc6iM6dA/LZto/hbPdv9LY2Qvds/4HLEzDqw==

Steps to reproduce

  1. click the button "count++"
  2. click the button "change show"
  3. click the button "change show"
  4. click the button "count++"

What is expected?

  1. the count display in the will increase
  2. the will remove
  3. the will show
  4. the count display in the will increase

What is actually happening?

  1. the count display in the will increase
  2. the will remove
  3. the will show
  4. the count display in the will NOT increase

System Info

window 10
vue 3.2.38

Any additional comments?

No response

@edison1105 edison1105 added 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. and removed 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Sep 5, 2022
@edison1105
Copy link
Member

workaround: use v-show instead.

  <span v-show="show" v-memo="[count,show]">{{count}}</span> 

@edison1105 edison1105 added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Sep 5, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants