T
T
tolorov2017-07-01 01:57:33
Vue.js
tolorov, 2017-07-01 01:57:33

Why use a transition component when you can just add classes?

A good example of doing the same thing in two ways - https://codepen.io/kodej/pen/eRMmrK
When to use what? Why does , exist at all <transition>, if you can just add Vyuhoy classes? Performance? Are there benchmarks? Or what's the fun?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2017-07-01
@tolorov

Imagine that you are adding a vue component to the dom and you need to make an appearance animation. You will have to assign a class in the mount event of the component that will be responsible for the appearance. In order not to write code, but to do it declaratively, there is a transition.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question