Skip to content
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

When using Vue's runtime template, passing rootProps of type ref results in a props validation error. #11974

Closed
bosens-China opened this issue Sep 19, 2024 · 3 comments

Comments

@bosens-China
Copy link

Vue version

3.5.6

Link to minimal reproduction

https://codesandbox.io/p/sandbox/romantic-hugle-2j4fhj

Steps to reproduce

When using Vue's runtime template, passing rootProps of type ref triggers a props validation error. Simply clicking the link to enter the page and opening the console will show the warning message.

What is expected?

When using Vue's runtime template, passing rootProps of type ref triggers a props validation error. This behavior differs from how ref is automatically unwrapped when used in an App.vue template. Simply clicking the link to enter the page and opening the console will show the warning message.

What is actually happening?

image

System Info

No response

Any additional comments?

No response

@LinusBorg
Copy link
Member

LinusBorg commented Sep 19, 2024

That's expected. rootprops is not a reactive object in which refs would be unwrapped.

Just use count: count.value to pass the ref's value.

@bosens-China
Copy link
Author

@LinusBorg I think this is wrong, if I pass.value, it will lose the responsiveness, but if I write it in a single file, it is OK, so can you give me a specific explanation?

@bosens-China
Copy link
Author

Also my problem is the props check problem, the code can run

@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants