Subscribe on changes!

Leaving transition does not work properly when using JavaScript hooks.

avatar
Feb 19th 2021

Version

3.0.5

Reproduction link

https://codepen.io/ustbhuangyi-the-bold/pen/MWboJav

Steps to reproduce

  1. Click the Toggle button, wait for the enter transition end.
  2. Then click the Toggle button again.

What is expected?

The leaving transition works well and after the transition end, the red square disappear.

What is actually happening?

The square disappear immediately, the leaving transition does not work properly.

avatar
Feb 19th 2021

This will be fixed in https://github.com/vuejs/vue-next/pull/3230, as a workaround, you can use v-if instead of v-show.

avatar
Feb 19th 2021

Another workaround, you can remove the changes to the state, see https://codepen.io/hcysunyang/pen/wvoeOaa

avatar
Feb 19th 2021

Another workaround, you can remove the changes to the state, see https://codepen.io/hcysunyang/pen/wvoeOaa

Haha, that's the reason why it looks strange. But I do need to do this