-
-
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
Wrong merging of props and emits definitions from mixins #7989
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
🐞 bug
Something isn't working
Comments
lehni
changed the title
Various bugs when merging props and emits definitions from mixins
Wrong merging of props and emits definitions from mixins
Mar 30, 2023
edison1105
added
🐞 bug
Something isn't working
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
labels
Mar 30, 2023
yyx990803
pushed a commit
that referenced
this issue
Apr 10, 2023
Thanks @yyx990803! Somewhat related, I'd like to highlight this gnarly bug here in the devtools: Would be great to get this merged and released soon. |
IAmSSH
pushed a commit
to IAmSSH/core
that referenced
this issue
May 14, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
🐞 bug
Something isn't working
Vue version
3.2.47
Link to minimal reproduction
https://sfc.vuejs.org/#eNq1VEuL2zAQ/ivCFHxxLLq9GRPo3ksPLb3Ue3CTcaKwloQkJynG/72jl6082G7p7iXRjD59M988PGafpSyPA2RVVhvo5XNrYN1wQuotO7oDHvcf1z8GIJ/IF3ZmnDwOO11TdIbrrxwIjcb3k1gMvFnsmnrKmiaB0NQbxaRxENZLoQyxhJ0SPclLimebX55cW8p4jefr6xA0IVhAFgZnB9tC1w7Phow+143A1xy40RUZLUdh4xSRbbIo/KnpnG5WZD7iqm9ledCCYxEdWxMudJMhmedvMszA2k22N0bqilLdbWxaB10KtaN4KtXADeuhBN2vfilx0qCQuMmKhIOi8whqpYBvQYF6ifMKesMbRE0oxbXWFvugUca9GkklMAT5mWOZ8ieXEvTM1su7CpKbk3B/ewXO7sSg8qckgO3E3wKEgiHXfEbrt4SKfDOK8V2oBomvKx/Ye32jLrPr2NGlo9k5ZvPYajdX13PfmIvBf1iPI/kgpGGC65K3PZBpwtl/iAgZDkv2Cd658EHA0ghOXoUc01fOdfPq7vagkLAfVsftIlmV8yJEyemuxK7PoGQMXlwXWwqsOyLz0A44Gxwz1GLjBF9v2WwLIi1W/3KNUEHYzv9RkO57MmevUYDI1ytA8D0FyyfmfdrwZmJ9ov/UsWIOeqt8+gPEpA3m
Steps to reproduce
Define
props
andemits
definitions as arrays in mixins, and use multiply mixins in a component. The defintions get wrongly merged, because the internalmergeOptions()
helper uses the wrong merge strategies for these fields:mergeObjectOptions
which ends up treating arrays as objects.Both actually have an empty
// TODO
behind them, I imagine it's about this problem, and got forgotten:core/packages/runtime-core/src/componentOptions.ts
Lines 1047 to 1048 in 4c9bfd2
What is expected?
The fields should be correctly merged. For props, if one of the encountered props is an object instead of an array, all definitions should be converted to object notation and merged.
What is actually happening?
The arrays are being treated as objects, and their indices become object keys and override each other:
The text was updated successfully, but these errors were encountered: