Subscribe on changes!

Type Ref Confused use in template

avatar
Dec 10th 2021

Version

3.2.24

Reproduction link

github.com/Math-chen/demo

Steps to reproduce

I provide a minimal reproduction in src/App.vue and my question is explained in the notes

What is expected?

the use of Ref has consistent expression in the template

What is actually happening?

the use of Ref Confused use in the template

avatar
Dec 10th 2021

I think you are confused about the process of unwrapping. What Unwrapping is, is explained here: (green info box)

The return value of setup is not deeply unwrapped, however - only the top level properties are unwrapped.

so a ref nested in a non-reactive object will stay a ref.

So in summary, this is expected behavior. We will document this better in the new version of the docs that we are working on right now.