Is there a difference between using the value of ref or do unref for that ref? #9449
-
Hello guys, I describe 2 refs, the first one with a simple value (just a number) and the second with a complex value (array of objects).
Is there a difference between using the value of ref or do unref for that ref? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You should simply use |
Beta Was this translation helpful? Give feedback.
You should simply use
.value
if you look at https://vuejs.org/api/reactivity-utilities.html#unref, you can see it's just a wrapper around the followingval = isRef(val) ? val.value : val
, you already know from the context (and typescript probably) that it's a ref in this case.