const vm={error:ref("aaa")} 使用 {{vm.error}} 会多渲染出一对双引号
Version
3.2.31
Reproduction link
Steps to reproduce
const vm={error:ref("aaa")} 使用 {{vm.error}} 会多渲染出一对双引号
What is expected?
显示 aaa
What is actually happening?
显示 “aaa”
This is expected as you logged a raw Ref, which will run its value through JSON.stringify()
You want to red the ref's value:
{{ vm.error.value }}
The value is not unwrapped because vm is not a reactive object.
It's a ref.
vm is not a reactive object, so its contents will not be unwrapped in the template.
So reading vm.error gives you the ref, not "aaa"