vue使用transition組件動畫效果的實例代碼
transition文檔地址定義一個背景彈出層實現(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>
到此這篇關于vue使用transition組件動畫效果的實例代碼的文章就介紹到這了,更多相關vue transition組件動畫內容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持好吧啦網(wǎng)!
相關文章:
1. python實現(xiàn)讀取類別頻數(shù)數(shù)據(jù)畫水平條形圖案例2. python中PyQuery庫用法分享3. python操作數(shù)據(jù)庫獲取結果之fetchone和fetchall的區(qū)別說明4. Ajax實現(xiàn)頁面無刷新留言效果5. 阿里前端開發(fā)中的規(guī)范要求6. JSP+Servlet實現(xiàn)文件上傳到服務器功能7. 關于HTML5的img標簽8. php5.6不能擴展redis.so的解決方法9. CSS3實現(xiàn)動態(tài)翻牌效果 仿百度貼吧3D翻牌一次動畫特效10. PHP獲取時間戳等相關函數(shù)匯總
