-
-
Notifications
You must be signed in to change notification settings - Fork 8.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
Mixins are not merged correctly for built-in options in this.$options
#3566
Comments
It seems like Vue 2 does add them to |
Yeah I've checked it's how devtools currently manage to categorize properties into |
@HcySunYang Yeah I believe both issues rely on options being merged correctly. |
@HcySunYang I think it's a bit different. #2119 was initially about being able to retrieve So, IMO solving this issue doesn't require solving the other one and this one is more about consistency with Vue 2 while the other one is about a missing feature given the new behavior and also about devtools. So we should prioritize this one over the other one |
Currently devtools for Vue 3 only handles computed/inject keys on the component's base definition, so even if we expose It's trivial for devtools to account for mixins though, we just need to do a merge on the devtools side for computed/provide/inject here /cc @Akryum I don't think app code should rely on core merge behavior for |
Will take a look tomorrow |
It seems it doesn't work well for |
Yeah currently What I'm suggesting is for devtools to also check |
Version
3.0.11
Reproduction link
SFC Playground
Steps to reproduce
Define a component with options API:
What is expected?
this.$options.computed
should contain bothfoo
andbar
as keys:What is actually happening?
It seems to affect all built-in options: https://github.com/vuejs/vue-next/blob/870f2a7ba35245fd8c008d2ff666ea130a7e4704/packages/runtime-core/src/componentOptions.ts#L973
This also makes Devtools unable to show
data
/computed
/... defined in mixins as it relies onthis.$options
.The text was updated successfully, but these errors were encountered: