-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Same-name Shorthand with imported const #11745
Comments
It seems the reproduction link is incorrect. Could you please check it? |
@jh-leong fixed. Sorry for that. But as I said: it wasn't really possible to re-create it there. Even locally I sometimes need to restart vitest to see the bug. |
We will have a hard time investigating this without a way to reproduce it. |
Works properly when I switch to Prod |
duplicate of #11273 |
@edison1105 This issue here is not related to SSR. If this is a duplicate, does that mean that #11273 is also not related to SSR? |
Neither of them is related to SSR. |
@edison1105 I just want to point out that it works perfectly fine without the same name shorthand syntax. As soon as I write EDIT: And only if the property is written in "camelCase" and in "kebab-case" in the template. If it is just a single word, it seems to works fine. |
Vue version
3.4.38
Link to minimal reproduction
https://play.vuejs.org/[...]
Steps to reproduce
There is something really weird happening.
First of all, in the reproduction link I am doing the same as locally, but there the issue is not visible. :(
I import a const (i.e. a string array) and directly pass it to a child component via the same-name shorthand.
In the child the data is not received. It is not in $attrs either. Everything else is passed. But not the imported data.
If I re-assign it to a different variable name, it works:
Inside of Comp:
Inside Comp I get the following:
{ "linkCollection2": [ "foo", "bar" ] }
.Isn't that bizare? I mean, I assigned linkCollection2 from linkCollection and passed BOTH to the Comp, but only the latter gets received.
If I change the same-name shortcut
:link-collection
to:link-collection="linkCollection"
, it works as expected. Do I change it back it STILL WORKS - until I restart vite (5.4.2).Seriously, I don't get it.
Super scary. As the linter and vue-tsc don't complain, but the data is just not there.
What is expected?
Imported data should be passed in same-name shortcut as well.
What is actually happening?
Data is undefined.
System Info
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: