-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
Аn unexpected behaviour when using <transition> with a Vue component. #4921
Comments
<transition>
with a Vue component.
Thanks for opening the issue. Even though I'd add the V-if/v-show in the parent template (https://jsfiddle.net/posva/bhrztdjn/5/), the behaviour is not consistent and at the very least docs should be updated to add a warning about it. Why do you add the |
@posva, yes. For example it needed in modal component. Watcher on the |
@posva , is this the expected behavior? Is the tag allowed transition only if follow
Here is the code: jsfiddle |
Dear antixrist : ) I think this is not a good idea because it looks like you want to use |
@gebilaoxiong nope. Here is my modal component with example.
|
I had a transition which worked with v-if but not with v-show. I had to resort to this solution https://medium.com/vuejs-tips/css-only-v-show-fade-animation-6f7818fdff4 for it to work |
I am facing the same problem @antixrist describes in the initial post. My child component holds data that, among other things, contains whether it should be visible (mutableDisplayData.visible). This is how the structure looks (simplified) <transition>
<child>
<template>
<div v-if="mutableDisplayData.visible">
...
</div>
</template>
<child>
</transition> The enter animation runs fine. On leave, it is immediately removed from the dom which I think is a bug. Any ideas on how to achieve what I need? |
It appears that this issue is back. Im having the same warningson version 2.6.6 |
I think
(or something like that) would be a better title. Would make it easier to find it. |
Hi @antixrist Update: |
Vue.js version
2.1.10
Reproduction Link
https://jsfiddle.net/bhrztdjn/4/
Steps to reproduce
Click on "Toggle" button.
What is Expected?
Transitions for a component should have the same behavior as transitions applied to HTML element.
What is actually happening?
A CSS transition works fine with an HTML element with both directive -
v-if
andv-show
(as declared in docs).But for the component, which has a directive v-show on its root element the transition isn't applied on entering and leaving states.
And for the component, which has a directive v-if on its root element the transition isn't applied on leaving state.
The text was updated successfully, but these errors were encountered: