vue使用transition組件動(dòng)畫(huà)效果的實(shí)例代碼
transition文檔地址定義一個(gè)背景彈出層實(shí)現(xiàn)淡入淡出效果
<template> <div> <button @click='show = !show'> Toggle </button> <transition name='fadeBg'> <div 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>
到此這篇關(guān)于vue使用transition組件動(dòng)畫(huà)效果的實(shí)例代碼的文章就介紹到這了,更多相關(guān)vue transition組件動(dòng)畫(huà)內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. IntelliJ IDEA設(shè)置默認(rèn)瀏覽器的方法2. docker鏡像完全卸載的操作步驟3. 使用Maven 搭建 Spring MVC 本地部署Tomcat的詳細(xì)教程4. IntelliJ IDEA導(dǎo)入jar包的方法5. IntelliJ IDEA恢復(fù)刪除文件的方法6. IntelliJ IDEA配置Tomcat服務(wù)器的方法7. idea刪除項(xiàng)目的操作方法8. idea重置默認(rèn)配置的方法步驟9. idea導(dǎo)入maven項(xiàng)目的方法10. Docker 部署 Prometheus的安裝詳細(xì)教程

網(wǎng)公網(wǎng)安備