`Ref` value returned by function won't get unwrapped
See original GitHub issueVersion
3.2.31
Reproduction link
Steps to reproduce
- refer a
Ref
value returned by a function in<template>
- confirm that the returned value won’t get unwrapped automatically
What is expected?
expect this will work.
<template>
<pre v-html="getVal()"></pre>
</template>
What is actually happening?
I have to unwrap the value myself:
<template>
<pre v-html="getVal().value"></pre>
</template>
x
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
vuejs/composition-api - Unwrap ref from function in template
I have function(fn) which return ref, but this ref will not unwrapped in template: I want to have similar result as for fn2...
Read more >Cannot move out of value which is behind a shared reference ...
Option::unwrap() consumes the option, that is, it accepts the option by value. However, you don't have a value, you only have a reference...
Read more >Vue 3 Composition API: How to Omit `.value` in refs
In this article, we discuss how to omit in VueJS refs, creating APIs by converting them into reactive variables using macros.
Read more >Prevent unpacking of ref w. composition API - Vue Forum
When using vue3 with the new composition API and the ref function, when returning the refs into the tempalte, the refs get unpacked...
Read more >Built-in function reference - Puppet
This page is a list of Puppet's built-in functions, with descriptions of what they do and how to use them. Functions are plugins...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Unwrapping occurs in the compilation phase,Unable to process return value of function.
@ygj6 Got it, thanks!