Transition document address defines a background pop-up layer to achieve fade-in and fade-out effects <template> <div> <button @click="show = !show"> Toggle </button> <transition name="fadeBg"> <div class="bg" v-if="show">hello</div> </transition> </div> </template> <script> export default { data: () => ({ show: true }), }; </script> <style lang="less" scoped> .fadeBg-enter-active, .fadeBg-leave-active { transition: opacity 0.3s ease; } .fadeBg-enter, .fadeBg-leave-to { opacity: 0; } .bg { position: fixed; top: 20px; left: 0; z-index: 105; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); } </style> This is the end of this article about the example code of using transition component animation effect in Vue. For more relevant Vue transition component animation content, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: A brief discussion on docker-compose network settings
>>: MySQL5.6.31 winx64.zip installation and configuration tutorial
This article will use Docker containers (orchestr...
How does "adaptive web design" work? It’...
The first one : Copy code The code is as follows: ...
1. Back button Use history.back() to create a bro...
Achieve results Implementation Code html <div ...
Table of contents Preface 1. Arrange the installa...
Today we are going to make origami airplanes (the...
By default, Nginx supports only one SSL certifica...
This article describes how to configure a seconda...
1.vue packaging Here we use the vue native packag...
The :not pseudo-class selector can filter element...
Today, my colleague encountered a very strange pr...
In Node.js, a .js file is a complete scope (modul...
introduction During the front-end project develop...
Usage of having The having clause allows us to fi...