-
Notifications
You must be signed in to change notification settings - Fork 96
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
Feature/custom component prefix on #102
base: dev
Are you sure you want to change the base?
Conversation
Looks cool, also waiting for review of this |
|
||
// in jsx, event binding use Camel case, such as `onClick`, `onMouseDown`; | ||
// in HTML Specification, event binding is all lower case, such as `onclick`, `onmousedown` | ||
// so for `on` and `nativeOn` attribute in jsx, transform `name` to all lower case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But camel case is allowed in Vue.js, though not preferred https://vuejs.org/v2/guide/components-custom-events.html#Event-Names
Thanks for the PR! Could you please also add some tests to this fix? |
Any progress in this PR? |
Is there any progress in this PR merger plan? |
Why
For custom components(which tag name is not html tag), event binding need to use
nativeOn
but noton
.So
on
prefix in custom component should transform toattrs
.Example
When render custom component use jsx, such as storybook vue example:
Before fix:
onChange
transform toon
event ofmy-component
.After fix:
onChange
transform toonChange
attribute ofmy-component
, and render as Props insidemy-component
as expected.EOF