-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Kebab-case boolean props are casted to string when used in custom elements #7401
Comments
I think this problem is related to the online editor. The performance in Vue SFC Playground is normal => here |
No, it's specific to the combo of a boolean kebap-case prop being passed to a Vue component that's being wrapped with #7412 will solve it for the most part, I think, but would still be an edge case left concerning async custom elements, which I hope to address after we are done with #7412. |
This is not a bug. When you declare a prop named
It should be kept in mind that a Vue custom element is a custom element that does not assume usage inside a Vue app environment. The framework agnostic way to pass <my-component test-prop></my-component>
// or, equivalent
<my-component test-prop=""></my-component>
<my-component test-prop="test-prop"></my-component> The conversion between kebab-case and camelCase props is Vue component specific feature because Vue components do not have the separation between DOM properties vs attributes. We do not encourage authoring Vue custom elements that only work in Vue apps, therefore we do not support special behavior when using Vue custom elements inside a normal Vue app. |
Vue version
3.2.45
Link to minimal reproduction
https://codesandbox.io/s/adoring-bell-zg9vvr
Steps to reproduce
What is expected?
A Boolean prop in the component
What is actually happening?
A String prop in the component
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: