A root routing component (the root routing component under the app, which needs to be scrolled as its child component) Vue routing switching transitionVue transition <transition :name="transitionName"> <div></div> </transition> Use transition to wrap the component that needs to transition, or a div, or a route. When it is created or destroyed, the specified animation effect will be loaded. This animation effect needs to be specified by yourself. Here, the specified transitionName Then declare this in data, but assign this value to ' ', because different names need to correspond to the forward or backward routing. When the route is forward (downward in this case), specify slide-down Then define the activation effects in different states of slide-down as transition effects .slide-down-enter-active, .slide-down-leave-active { transition: all 500ms; position: absolute; } Then define the start animation .slide-down-enter { opacity: 0; transform: translate3d(0, 100%, 0); } Define the leave activation animation .slide-down-leave-active { opacity: 0; transform: translate3d(0, -100%, 0); } The following is generally fixed, that is, declare -enter-active, -leave-active as a transition effect and then write -enter, -leave-active. The specific changes required are generally one -enter, one -leave-active. Next is how to determine whether the route is forward or backward. First, how to switch the route forward and backward Next, how to determine whether it is the front or the back? When writing the route, write the meta, and when monitoring the route changes in the "root component", get the route information, and compare the sizes of the two to determine This is the end of this article about how to implement the Vue mouse wheel scrolling route switching effect. For more relevant Vue route switching content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Use of Linux watch command
>>: Detailed explanation of mysql.user user table in Mysql
Table label composition The table in HTML is comp...
Many people have encountered this error when star...
Method 1: Set the readonly attribute to true. INPU...
Physical Structure of an InnoDB Index All InnoDB ...
1. First go to the official website to download t...
Table of contents 1. js memory 2. Assignment 3. S...
Slow log query function The main function of slow...
For websites with an architecture like LNMP, they...
When building a B/S system interface, you often en...
IP masquerading and port forwarding Firewalld sup...
Recorded the installation tutorial of mysql 5.7.1...
Table of contents A brief overview of the replica...
1. left(name,4) intercepts the 4 characters on th...
Preface In Java programming, most applications ar...
Quickstart Guide The Foreman installer is a colle...