-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
Vue not parsing prop names with numbers? #7344
Comments
If you remove the dash before 24 it seems to work. |
The way Vue is converting camelCase props to kebab-case is pretty simple: Lines 168 to 174 in f319bef
It only inserts a hyphen before upper case letters and convert them to lower case. And I think we cannot do much about numbers because adding hyphens around consecutive numbers will be a breaking change. |
@JosephusPaye Hi~🖖 you can do this =.= <my-component :use24hr-format="true" :use-military-time="true"></my-component> |
This is a behavior that is hard to say whether it's right or wrong. And since changing it would be breaking to existing code, we have to leave it as is. |
Version
2.5.13
Reproduction link
https://jsfiddle.net/JosephusPaye/yqnjyq1k/2/
Steps to reproduce
What is expected?
The prop,
use24hrFormat
(use-24hr-format
) should be parsed and the value in the component should betrue
.What is actually happening?
The prop is not parsed and the value in the component is the default value,
false
.Hi,
I'm working on a time picker (using a SFC) and want to have a Boolean prop to determine whether to use 24-hour format for the time or not. However, using the prop
use24hrFormat
and the template equivalentuse-24hr-format
doesn't seem to be working. When I switch to other props, for exampleuseMilitaryTime
, it works fine.I'm thinking this has something to do with the number in the prop name. Maybe using numbers in prop names like this is not supported, but I wasn't able to find anything about this in the docs.
Thanks for your time.
The text was updated successfully, but these errors were encountered: