Home > Web Front-end > Vue.js > body text

How vue.js implements the move-in and move-out effect

王林
Release: 2023-01-13 00:45:47
Original
2919 people have browsed it

Vue.js method to implement the move-in and move-out effect: [methods:{enter(index){this.seen = true;this.current = index;},leave(){this.seen = false;this .cur...].

How vue.js implements the move-in and move-out effect

The operating environment of this article: windows10 system, vue 2.5.2, thinkpad t480 computer.

vue.js specific code to implement move-in and move-out events:

html code:

<i class="icon" @mouseenter="enter(index)" @mouseleave="leave()"></i>
Copy after login

Logic code:

methods:{
      enter(index){
        this.seen = true;
        this.current = index;
      },
      leave(){
        this.seen = false;
        this.current = null;
      }
    }
Copy after login

Recommended learning: php Training

The above is the detailed content of How vue.js implements the move-in and move-out effect. 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