Vue入門之a(chǎn)nimate過渡動(dòng)畫效果
簡介:
- transition方法的使用
- transition內(nèi)置方法
- transition-group
animate庫實(shí)現(xiàn)過渡動(dòng)畫
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="lib\vue.js"></script>
<link rel="stylesheet" href="lib\animate.css" rel="external nofollow" >
<style>
[v-cloak] {
display: none;
}
p {
width: 100px;
height: 100px;
background: red;
margin: 10px auto;
}
/* .fade-enter-active, .fade-leave-active {
transition: 1s all ease;
}
.fade-enter-active {
opacity: 1;
width: 300px;
height: 300px;
}
.fade-leave-active {
opacity: 0;
width: 100px;
height: 100px;
}
.fade-enter, .fade-leave {
width: 100px;
height: 100px;
opacity: 0;
} */
</style>
<script>
window.onload = function() {
new Vue({
el: '#box',
data: {
show: '',
list: ['apple', 'banana', 'orange', 'pear']
},
computed: {
lists: function() {
var arr = [];
this.list.forEach(function(val) {
if (val.indexOf(this.show) != -1) {
arr.push(val);
}
}.bind(this))
return arr;
}
}
})
}
</script>
</head>
<body>
<div id="box" v-cloak>
<input type="text" v-model="show">
<!-- class定義 .fade
.fade-enter{} 初始狀態(tài)
.fade-enter-active{} 進(jìn)入過程
.fade-leave{} 離開狀態(tài)
.fade-leave-active{} 離開過程
-->
<transition-group enter-active-class="zoomInLeft" leave-active-class="bounceOutRight">
<!-- 內(nèi)置方法
@before-enter = "beforeEnter"
@enter = "enter"
@after-enter = "afterEnter"
@before-leave = "beforeLeave"
@leave = "leave"
@after-leave = "afterLeave"
-->
<!-- transition-group 多個(gè)元素運(yùn)動(dòng),注意綁定key:1 -->
<p v-show="show" class="animated" v-for="(val, index) in lists" :key="index">
{{val}}
</p>
</transition-group>
</div>
</body>
</html>
總結(jié)
以上所述是小編給大家介紹的Vue入門之a(chǎn)nimate過渡動(dòng)畫效果,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
- vue實(shí)現(xiàn)列表滾動(dòng)的過渡動(dòng)畫
- 使用vue-router切換頁面時(shí)實(shí)現(xiàn)設(shè)置過渡動(dòng)畫
- vue中組件的過渡動(dòng)畫及實(shí)現(xiàn)代碼
- Vue 解決路由過渡動(dòng)畫抖動(dòng)問題(實(shí)例詳解)
- Vue運(yùn)用transition實(shí)現(xiàn)過渡動(dòng)畫
- Vue動(dòng)畫事件詳解及過渡動(dòng)畫實(shí)例
- 簡單談?wù)剉ue的過渡動(dòng)畫(推薦)
- 解決vue的過渡動(dòng)畫無法正常實(shí)現(xiàn)問題
- Vue中的基礎(chǔ)過渡動(dòng)畫及實(shí)現(xiàn)原理解析
- Vue中實(shí)現(xiàn)過渡動(dòng)畫效果實(shí)例詳解
相關(guān)文章
vue實(shí)現(xiàn)氣泡運(yùn)動(dòng)撞擊效果
這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)氣泡運(yùn)動(dòng)撞擊效,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-08-08
Element-ui中的Cascader級聯(lián)選擇器基礎(chǔ)用法
這篇文章主要為大家介紹了Element-ui中的Cascader級聯(lián)選擇器基礎(chǔ)用法,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-06-06
Vue3封裝hooks實(shí)現(xiàn)實(shí)時(shí)獲取麥克風(fēng)音量
這篇文章主要為大家詳細(xì)介紹了Vue3如何通過封裝一個(gè)hooks實(shí)現(xiàn)實(shí)時(shí)獲取麥克風(fēng)音量功能,文中的示例代碼講解詳細(xì),需要的小伙伴可以參考一下2024-03-03
vue?iview?導(dǎo)航高亮動(dòng)態(tài)設(shè)置方式
這篇文章主要介紹了vue?iview?導(dǎo)航高亮動(dòng)態(tài)設(shè)置方式,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-05-05
vue keep-alive 動(dòng)態(tài)刪除組件緩存的例子
今天小編就為大家分享一篇vue keep-alive 動(dòng)態(tài)刪除組件緩存的例子,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-11-11
echarts3如何清空上一次加載的series數(shù)據(jù)
這篇文章主要介紹了echarts3如何清空上一次加載的series數(shù)據(jù),具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-10-10
nginx部署訪問vue-cli搭建的項(xiàng)目的方法
本篇文章主要介紹了nginx部署訪問vue-cli搭建的項(xiàng)目的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-02-02

