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
stat function and stat command Explanation of [in...
Preface Generally speaking, when we talk about Li...
Table of contents In JavaScript , there are sever...
1. Space rules Whitespace within HTML code is usu...
Table of contents Scope Global Scope Function Sco...
Knowledge points about Memory storage engine The ...
MySQL's foreign key constraint is used to est...
Table of contents Preface 1. bat executes js 2. T...
This article example shares the specific code of ...
title XML/HTML CodeCopy content to clipboard <...
Preface smb is the name of a protocol that can be...
Table of contents 1. Install Docker 2. Install Gi...
Creating a Vue 3.x Project npm init @vitejs/app m...
Nginx, pronounced "engine x," is an ope...
Note: This table is quoted from the W3School tuto...