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

Vue: Ability to detect v-show state from components #11663

Closed
atyshka opened this issue Sep 14, 2020 · 1 comment
Closed

Vue: Ability to detect v-show state from components #11663

atyshka opened this issue Sep 14, 2020 · 1 comment

Comments

@atyshka
Copy link

atyshka commented Sep 14, 2020

What problem does this feature solve?

This problem has been mentioned before, but I thought I'd propose re-examining it as it's relevant to my particular use case. I am creating a vue wrapper for mapbox, a map library. I would like to modularize the map with vue components, but since mapbox is webgl based, these components have no DOM elements and simply abstract javascript logic. However, I have no way to implement v-show since it is not linked to the DOM. Instead I would like to be able to detect a state change, and then call the corresponding JS function to hide/show the relevant content from the map. I know that this can be easily done via a custom prop coupled with watch, but it's counterintuitive, especially in a public library, to not use the native vue hide/show methods.

What does the proposed API look like?

Adding optional lifecycle hooks for hide/show would cover this use case.

@posva
Copy link
Member

posva commented Sep 14, 2020

Unfortunately, it doesn't have any lifecycle or anything but using a prop to control visibility is totally fine and you should use that solution.


Remember to use the forum or the Discord chat to ask questions!

@posva posva closed this as completed Sep 14, 2020
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

No branches or pull requests

2 participants