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>
到此這篇關(guān)于vue使用transition組件動畫效果的實例代碼的文章就介紹到這了,更多相關(guān)vue transition組件動畫內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. PHP正則表達式函數(shù)preg_replace用法實例分析2. 一個 2 年 Android 開發(fā)者的 18 條忠告3. vue使用moment如何將時間戳轉(zhuǎn)為標準日期時間格式4. js select支持手動輸入功能實現(xiàn)代碼5. Android 實現(xiàn)徹底退出自己APP 并殺掉所有相關(guān)的進程6. Android studio 解決logcat無過濾工具欄的操作7. 什么是Python變量作用域8. vue-drag-chart 拖動/縮放圖表組件的實例代碼9. Spring的異常重試框架Spring Retry簡單配置操作10. Vue實現(xiàn)仿iPhone懸浮球的示例代碼
