vue使用transition組件動(dòng)畫效果的實(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)畫效果的實(shí)例代碼的文章就介紹到這了,更多相關(guān)vue transition組件動(dòng)畫內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. CSS hack用法案例詳解2. asp(vbs)Rs.Open和Conn.Execute的詳解和區(qū)別及&H0001的說明3. 解決AJAX返回狀態(tài)200沒有調(diào)用success的問題4. PHP設(shè)計(jì)模式中工廠模式深入詳解5. ASP 信息提示函數(shù)并作返回或者轉(zhuǎn)向6. 利用promise及參數(shù)解構(gòu)封裝ajax請求的方法7. Ajax實(shí)現(xiàn)表格中信息不刷新頁面進(jìn)行更新數(shù)據(jù)8. JSP數(shù)據(jù)交互實(shí)現(xiàn)過程解析9. ThinkPHP5實(shí)現(xiàn)JWT Token認(rèn)證的過程(親測可用)10. .NET中l(wèi)ambda表達(dá)式合并問題及解決方法
