Skip to content

Retrieve resolved options of a component based on its mixins and app mixins #2119

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

Closed
posva opened this issue Sep 15, 2020 · 0 comments
Closed
Labels
✨ feature request New feature or request transferred to rfc discussions Please manually search in http://github.com/vuejs/rfcs/discussions for the latest discussions

Comments

@posva
Copy link
Member

posva commented Sep 15, 2020

What problem does this feature solve?

This would allow the router to read navigation guards added through mixins without having to instantiate the components. It was possible in Vue 2 with Vue.extend

From vuejs/router#454

What does the proposed API look like?

resolveComponentOptions(componentOptions: ComponentOptions, app?: App): ComponentOptions
  • apply local mixins option
  • if app is provided, also apply global mixins

This is of course just an idea, maybe it doesn't make sense to allow passing app.

It could also be a function like applyMixins(componentOptions) and I could append app._context.mixins

@yyx990803 yyx990803 added the ✨ feature request New feature or request label Sep 16, 2020
@vuejs vuejs locked and limited conversation to collaborators Aug 31, 2023
@haoqunjiang haoqunjiang converted this issue into a discussion Aug 31, 2023
@haoqunjiang haoqunjiang added the transferred to rfc discussions Please manually search in http://github.com/vuejs/rfcs/discussions for the latest discussions label Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✨ feature request New feature or request transferred to rfc discussions Please manually search in http://github.com/vuejs/rfcs/discussions for the latest discussions
Projects
None yet
Development

No branches or pull requests

3 participants