-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Should transition listen to the v-show set in the component root? #3431
Comments
@miljan-aleksic FYI, I implemented support for this but decided to revert it. The point is that So there are two options for the use case:
|
I was playing around with the changes and it introduced some new bugs difficult to confirm, plus during the process I had the chance to experiment more with the different configurations. Keeping the transitions direct gives you full power over the overall process which in more complex components could be necessary. I totally agree with your decision and thanks for letting me know, @yyx990803. |
I am not sure if it's the best way to go, but I thought that leaving the transition wrapper outside the components would leave more freedom to integrate it as required (for example with or without keep-alive, custom events callbacks, etc).
With that in mind and taking as example a modal component it would usually have a show prop used to control the modal display. Transition expects v-show to know when to start and to avoid this kind of code
<modal v-show="show" :show="show" />
the v-show would be set in the component root directly. The final code with transition would be simple asBut that would not work as transition expects v-show right there. There is a jsfiddle that illustrate the issue (just ignore the badly implemented transition css...).
I see two ways to solve this:
Vue.js version
2.0.0-rc1
Reproduction Link
https://jsfiddle.net/miljan/8Lca03gb/
Steps to reproduce
Try opening the modal
What is Expected?
To open with a transition, which does happen if you set v-show again in the component declaration.
What is actually happening?
It opens without a transition.
The text was updated successfully, but these errors were encountered: