Skip to content

When no dependencies are passed in, computed does not use the cache. #12857

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

Closed
MKbird1 opened this issue Feb 11, 2025 · 1 comment
Closed

When no dependencies are passed in, computed does not use the cache. #12857

MKbird1 opened this issue Feb 11, 2025 · 1 comment

Comments

@MKbird1
Copy link

MKbird1 commented Feb 11, 2025

Vue version

3.5

Link to minimal reproduction

https://play.vuejs.org/#eNqNUctOwzAQ/JWVL0nVKgjBqWorAeoBDoCAoy9Wug0pjm35ESpF+XfWjhJaCRA3a2Z2PLPbsRtjijYgW7KVK21tPDj0wWy4qhujrYcOLIrS1y0uSt2Y4HEHPeytbiCjwYyrUitHY154hPWkzjuuAMQSLrnqZ2equ9FnDaNlns9gvYE0E5VaYiF1lWcio1kgVx+sOvUaFWeORStkQFIktBDz+X/Eq4uhOpVeeWyMJBG9ASI1AWzBvCOzfV0VB6cVrSzF5SyWqCXaJ+Nr+oyz5VAkckJK/fmQMG8DLka8fMfy4wf84I4R4+zZokPbImcT54Wt0A/09vURj/SeyEbvgiT1H+QL0iJCzDjIboPaUewTXUp7nw5fq+rNbY8elRtLxaBR2Sc9Z3T+uMvfqn/HvSqu0xxdj/Vfdv/Vcg==

Steps to reproduce

<script setup>
import { reactive,computed } from 'vue'
const state = reactive({
  a: 1
})
const stateComputed = computed(() => {
  console.log('a')
  return 1
})
console.log(stateComputed.value)
state.a++
console.log(stateComputed.value)
</script>

What is expected?

print a 1 1

What is actually happening?

print a 1 a 1

System Info

Any additional comments?

No response

MKbird1 added a commit to MKbird1/core that referenced this issue Feb 11, 2025
@skirtles-code
Copy link
Contributor

I think this may be a duplicate of #12337.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants