-
Notifications
You must be signed in to change notification settings - Fork 266
Bug: ref inside prop gets converted to primitive value on mount #1985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @tkalmar Thanks for the repro, but shouldn't that be |
There is a message getter which i would call to hide the inner workings of my wrapper ... |
Ha I see. So it works with |
That is exactly the problem. |
inside the getter msg is a simple string so .value is undefined, that is what i get when examining in the test.
and JSON stringify the prop then the value is working as expected :/ i'm totaly lost |
Yeah I think it's related to vuejs/core#3797 : VTU wraps the props into a reactive object to make them reactive (and allows to call I suggest you track the issue there, as I don't think we'll be able to fix it in VTU. |
I'll close, as I confirm this is an upstream issue. You'll run into the same problem if you have: <script setup>
import { ref, reactive } from 'vue'
const o = reactive({ a: 1, get b() { 2 } })
</script>
<template>
<h1>{{ o.a }}</h1> <!-- displays: 1 -->
<h2>{{ o.b }}</h2><!-- displays nothing -->
</template> |
Describe the bug
Somehwhere along the way the internal ref of an prop is converted to an simple value. As seen in the reproducer on line 15 the internal ref got converted to an string and is no longer a ref.
To Reproduce
Reproducer
Expected behavior
The ref should stay a ref, and the test completes flawless
Related information:
Additional Context:
The component works as expected, only test is not working.
The text was updated successfully, but these errors were encountered: