-
-
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(customElement): handle hyphenated prop pass to custom element #12032
Conversation
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-core
@vue/compiler-ssr
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
|
||
if (key in el) { | ||
// if el is a Vue custom element, it should be passed as a prop. | ||
if (camelize(key) in el) { |
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.
this change is unnecessary. see line 142
@@ -95,7 +95,7 @@ export function patchDOMProp( | |||
// some properties has getter, no setter, will error in 'use strict' | |||
// eg. <select :type="null"></select> <select :willValidate="null"></select> | |||
try { | |||
el[key] = value | |||
el[camelize(key)] = value |
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.
this is the proper change. because the normalized prop key is always camelized
@@ -95,7 +95,7 @@ export function patchDOMProp( | |||
// some properties has getter, no setter, will error in 'use strict' | |||
// eg. <select :type="null"></select> <select :willValidate="null"></select> | |||
try { | |||
el[key] = value | |||
el[camelize(key)] = value |
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.
Shouldn't do it here as it affects all elements. This should only apply to Vue custom elements. See ea3efa0 (reused test from this PR)
close #12030