vue使用transition組件動畫效果的實例代碼
transition文檔地址定義一個背景彈出層實現淡入淡出效果
<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>
到此這篇關于vue使用transition組件動畫效果的實例代碼的文章就介紹到這了,更多相關vue transition組件動畫內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!
相關文章:
1. 解決Android studio xml界面無法預覽問題2. 基于android studio的layout的xml文件的創建方式3. 詳解Android studio 動態fragment的用法4. Android如何加載Base64編碼格式圖片5. 圖文詳解vue中proto文件的函數調用6. Spring Boot和Thymeleaf整合結合JPA實現分頁效果(實例代碼)7. 什么是python的自省8. .Net Core使用Coravel實現任務調度的完整步驟9. Vuex localStorage的具體使用10. Vue封裝一個TodoList的案例與瀏覽器本地緩存的應用實現

網公網安備