Home > Web Front-end > JS Tutorial > body text

Vue.js to js implementation transition

php中世界最好的语言
Release: 2018-03-13 14:26:03
Original
1204 people have browsed it

This time I will bring you the transition from Vue.js to js. What are the things to note when using Vue.js to implement the transition? The following is a practical case, let’s take a look.

When the label is hidden, the leave animation is executed;

When the label is displayed, the beforeEnter, enter animation is executed


js transition animation

Vue.js to js implementation transitionWhen I was learning the Ele.me takeaway app, I found that writing like this can also be done,

Add transition to the label to be animated

<div v-show="detailShow" class="detail" transition="fade">
Copy after login

In the CSS code

   .detail
      ......
      &.fade-transition
        opacity: 1        background: rgba(7, 17, 27, 0.8)
      &.fade-enter,&.fade-leave
        opacity: 0        background: rgba(7, 17, 27, 0)
Copy after login

In this way, you can simply implement an animation with excessive background transparency

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

Computed properties and data monitoring of Vue.js


Event binding of Vue.js- Built-in event binding, custom event binding


## Synchronous update method of list data in Vue.js


Vue.js list rendering v-for array object subcomponent

The above is the detailed content of Vue.js to js implementation transition. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template