-
-
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
fix(runtime-core): fix inconsistent event casing for render functions, see issue#2249 #2278
Conversation
ef0d319
to
55c7686
Compare
@LinusBorg Hello, I updated my test case. I think the new test case will meet our expectations. : ) |
Can you add dev warning like in vue 2 (#2249 (comment)) |
I think this will break in-browser templates: <the-component v-on:test-event="handler"> results in this render function: return (_openBlock(), _createBlock(_component_Mycomponent, { "onTest-event": _ctx.handler }, null, 8 /* PROPS */, ["onTest-event"])) So I think the camelCasing needs to be done in the compiler as well. |
@LinusBorg Yes, when I started fixing this bug, I had already considered fix event name in in-browser templates. But when I read the
I see a comment "Any non-declared (either as a prop or an emitted event) props are put into a separate attrs object for spreading. Make sure to preserve original key casing." So I think maybe in in-browser templates we need to make sure to preserve original key casing? I am not sure. If not, I will work on fixing camelCasing in compiler. : ) |
@posva Ok, I can add dev warning for in-DOM templates. But I want to make sure that is the warning context is the same as Vue2? The warning you mentioned in issue #2278 is :
|
@shadowings-zy That's not the warning, if you run the reproduction on the comment you will see it |
@posva Hello, the reproduction on the comment has nothing but an empty Vue2 project...... So I code an in-Dom template myself by using Vue2. And I found two warnings: One is in extract props:
Another is in emit event:
I think both of them need to added in Vue3. If so, I will add them. If not, which one is need to add for Vue3? : ) |
Yeah, it's the second one (https://github.com/vuejs/vue/blob/dev/src/core/instance/events.js#L123). Weird the jsfiddle wasn't what I had, probably forgot to press fork 😓 |
…sistent event casing for in-DOM template(vuejs#2249)
55c7686
to
fee467a
Compare
@posva @LinusBorg |
Hi there, I found my code suddenly didn't work after this merge :
would you please fix this issue ? |
Please open a bug. Commments on merged commits get lost quickly. |
@LinusBorg done #2429 |
In issue #2249 , we found inconsistent event casing for render functions.
The reproduction link in issue#2249 is here:
https://codesandbox.io/s/nervous-surf-f5lbs
In that case, when we emit
test-event
, onlyonTest-Event
worked. But the one expected to work on the render function should beonTestedEvent
.So I fix it in this PR, and add test case for it.
All test cases were passed.
Close #2249