Missleading rendering: Ref or computed inside non-wrappable variables (objects, arrays) which returns a string #5578
Labels
🍰 p2-nice-to-have
Priority 2: this is not breaking anything but nice to have it addressed.
✨ feature request
New feature or request
Version
3.2.31
Reproduction link
sfc.vuejs.org/
Steps to reproduce
I know that refs or computed-s inside objects and arrays don't get unwrapped in the templates.
And that's exactly the issue with the code below:
The solution is to just use .value
What is expected?
Since accessed element is an object which contains a
.value
property, an object should be rendered:What is actually happening?
"text" (with quotes) is rendered.
In many cases, it can be easy to forget or miss adding
.value
. And if that happens when a string is returned inside a computed or a ref inside an object or array, it might be difficult to debug since you are going to see the string you want, but inside quotes. And intuitively you might think this is a bug or an issue related to the quotes.The text was updated successfully, but these errors were encountered: