Skip to content
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(mount): pass unknown options to $options on mount #1079

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

xanf
Copy link
Collaborator

@xanf xanf commented Nov 16, 2021

Vue 3.x keeps the behaviour we've had in Vue2: all unknown fields in component are passed as $options. This allows you to do following:

createApp({ ...App, test: 123 }).mount("#app");

and access test on this.$options.test
While not in a great use in modern Vue 3 code, this is still a great importance when we work with @vue/compat - you are still want to be able to pass router/store/etc. in "legacy" way to your component

This PR restores this behavior

@xanf xanf force-pushed the mount-other-options branch from 3d2f9b2 to 975c2bf Compare November 16, 2021 18:45
Copy link
Member

@afontcu afontcu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants