Unexpected Behavior with Nested Refs in Computed Properties #10399
Unanswered
Scover-w
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
const myComp = computed(() => uRefRef.value? uRefRef.value.myRef : "Nop");
When using a ref that contains another ref (nested refs) inside a computed property, the expected reactivity behavior seems inconsistent. Specifically, unwrapping the inner ref does not require .value. This lead to a weird syntax where the first ref need .value and the second one don't. Futhermore, vscode create an error when myRef is used as a :key (it's written that it receive either a Ref|string), indicating that it does not understand that It is automatically unwrapped.
It is a bug that comes from the vue vs code plugin or vue ?
Vue Playground Exemple
useRef.js :
App.vue :
Beta Was this translation helpful? Give feedback.
All reactions