Is there a way to mark an object as raw to not unwrap it when returning from setup()
?
#619
matthew-dean
started this conversation in
General
Replies: 1 comment
-
I've run into the same problem of const no_unwrapping_refs = ref({
raw_thingies: markRaw({ // <-- extra object
thing: ref("value")
})
}) It looks like an ugly hack, but I haven't found a better solution. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I have a class that has properties that are Vue refs. In some instances, I pass the ref properties to sub-components / classes.
However, this:
...will shallowly unwrap the instance's properties so that refs are now their
.value
s. This is, of course, consistent with the documentation.However, when researching this, and coming across
markRaw
, I expected this instance to remain untouched after being returned from setup. I did this:To my surprise, even though this was marked as raw, the instance was still shallowly unwrapped. Is there a way to prevent this?
Beta Was this translation helpful? Give feedback.
All reactions