91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

在Vue中同時使用過渡和動畫

發布時間:2020-06-12 18:05:07 來源:網絡 閱讀:384 作者:梁十八 欄目:web開發

加一個功能,當刷新頁面的時候也有動畫效果(加上appear和appear-active-class="animated rubberBand":

<!DOCTYPE?html>
<html>
<head>
????<title></title>
????<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
????<link?rel="stylesheet"?type="text/css"?href="./animate.css">
????<script?src="./vue.js"></script>
????<!--?<script?src="http://cdn.staticfile.org/vue/2.6.10/vue.common.dev.js"></script>?-->
</head>
<body>
????<div?id="root">
????????//name隨便取名:
????????<!--?<transition?name="fade">
????????????<div?v-show="show">hello</div>
????????</transition>?-->
????????//自定義class名字:
????????<transition?
????????????name="fade"?
????????????appear?
????????????enter-active-class="animated?rubberBand"?
????????????leave-active-class="animated?hinge"?
????????????appear-active-class="animated?rubberBand"
????????>
????????????<div?v-show="show">hello</div>
????????</transition>
????????<button?@click="handleClick">切換</button>
????</div>
????<script?type="text/javascript">
????????var?vm?=?new?Vue({
????????????el:?"#root",
????????????data:?{
????????????????show:?true
????????????},
????????????methods:?{
????????????????handleClick:?function()?{
????????????????????this.show?=?!this.show
????????????????}
????????????}
????????});
????</script>
</body>
</html>

如果過渡和庫的動畫都有:

<!DOCTYPE?html>
<html>
<head>
????<title></title>
????<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
????<link?rel="stylesheet"?type="text/css"?href="./animate.css">
????<script?src="./vue.js"></script>
????<!--?<script?src="http://cdn.staticfile.org/vue/2.6.10/vue.common.dev.js"></script>?-->
????<style?type="text/css">
????????.fade-enter,?.fade-leave-to?{
????????????opacity:?0
????????}
????????.fade-enter-active,?.fade-leave-active?{
????????????transition:?opacity?3s
????????}
????</style>
</head>
<body>
????<div?id="root">
????????//name隨便取名:
????????<!--?<transition?name="fade">
????????????<div?v-show="show">hello</div>
????????</transition>?-->
????????//自定義class名字:
????????<transition?
????????????name="fade"?
????????????appear?
????????????enter-active-class="animated?rubberBand?fade-enter-active"?
????????????leave-active-class="animated?hinge?fade-leave-active"?
????????????appear-active-class="animated?rubberBand"
????????>
????????????<div?v-show="show">hello</div>
????????</transition>
????????<button?@click="handleClick">切換</button>
????</div>
????<script?type="text/javascript">
????????var?vm?=?new?Vue({
????????????el:?"#root",
????????????data:?{
????????????????show:?true
????????????},
????????????methods:?{
????????????????handleClick:?function()?{
????????????????????this.show?=?!this.show
????????????????}
????????????}
????????});
????</script>
</body>
</html>

但是,問題是,animate庫的動畫時長是1s,而我自己設置的是3s,所以要統一下時間。用type="transition",意思是以transition時間為準:

在Vue中同時使用過渡和動畫(但是經過測試,發現有問題)

還可以設置時間duration="10000",單位毫秒。還可以設置更細:duration="{enter: 5000, leave: 1000}":

<!DOCTYPE?html>
<html>
<head>
????<title></title>
????<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
????<link?rel="stylesheet"?type="text/css"?href="./animate.css">
????<script?src="./vue.js"></script>
????<!--?<script?src="http://cdn.staticfile.org/vue/2.6.10/vue.common.dev.js"></script>?-->
????<style?type="text/css">
????????.fade-enter,?.fade-leave-to?{
????????????opacity:?0;
????????}
????????.fade-enter-active,?
????????.fade-leave-active?{
????????????transition:?opacity?3s;
????????}
????</style>
</head>
<body>
????<div?id="root">
????????//自定義class名字:
????????<transition?
????????????:duration="{enter:?5000,?leave:?1000}"
????????????name="fade"?
????????????appear?
????????????enter-active-class="animated?rubberBand?fade-enter-active"?
????????????leave-active-class="animated?hinge?fade-leave-active"?
????????????appear-active-class="animated?rubberBand"
????????>
????????????<div?v-show="show">hello</div>
????????</transition>
????????<button?@click="handleClick">切換</button>
????</div>
????<script?type="text/javascript">
????????var?vm?=?new?Vue({
????????????el:?"#root",
????????????data:?{
????????????????show:?true
????????????},
????????????methods:?{
????????????????handleClick:?function()?{
????????????????????this.show?=?!this.show
????????????????}
????????????}
????????});
????</script>
</body>
</html>


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

宝坻区| 寿光市| 泰州市| 石屏县| 万全县| 昂仁县| 文昌市| 衡阳市| 沈阳市| 武功县| 苍山县| 肃北| 长治市| 富平县| 牙克石市| 临洮县| 承德市| 瑞金市| 从江县| 阳泉市| 稷山县| 松江区| 崇仁县| 章丘市| 荥经县| 涪陵区| 西平县| 海南省| 新乡县| 锦州市| 乌恰县| 贵阳市| 汝州市| 镶黄旗| 景谷| 五华县| 济阳县| 疏附县| 东源县| 津南区| 高密市|