Skip to content

Add Vue app to the vue:mount event #444

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

Merged
merged 1 commit into from
Sep 16, 2022
Merged

Conversation

pierredup
Copy link
Contributor

@pierredup pierredup commented Aug 27, 2022

Q A
Bug fix? no
New feature? yes
Tickets N/A
License MIT

Add the Vue app to the vue:mount event, so that users can have access to it when hooking into the event in order to use Vue Plugins with components. Without access to the app instance, it's not possible to use plugins.

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

Thanks @pierredup!

It's outside of the scope of this PR, but if you were able to add a small section to the docs (https://github.com/symfony/ux/blob/2.x/src/Vue/Resources/doc/index.rst) about the events, that'd be much appreciated. It's currently missing.

@t-richard
Copy link
Contributor

I thought about doing it in the intial PR but it requires special attention.

My fear was that people would use things like Vue router and that could get messy.

Maybe a simple notice in the docs would be enough ?

@weaverryan
Copy link
Member

A simple notice so that users are aware of the events is all that's needed - would you be able to do that @t-richard?

@pierredup
Copy link
Contributor Author

pierredup commented Aug 31, 2022

Actually I think this patch won't work, because plugins needs to be added before mounting the app. So there would need to be another event between createApp and mount. Something like vue:app, or vue:before-mount?

My fear was that people would use things like Vue router and that could get messy.

Vue router will work fine, as long as the hash history is used. For HTML5 history mode, the router might become a problem.

@weaverryan
Copy link
Member

WDYT @t-richard? This makes sense to me

@weaverryan
Copy link
Member

Thanks Pierre!

@weaverryan weaverryan merged commit 4478325 into symfony:2.x Sep 16, 2022
@pierredup pierredup deleted the patch-1 branch September 17, 2022 11:34
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