鍍金池/ 問答/HTML/ vue過渡對寬高無效

vue過渡對寬高無效

<!doctype html>
<html>
<head>
<title>test</title>
<script src="https://cdn.jsdelivr.net/npm/...;></script>
<style>

div {

width: 100px;
height: 100px;
background-color: red;

}
.v-enter {

width: 0

}
.v-enter-to {

width: 100px

}
.v-enter-active {

transition: all 1s;

}
.v-leave {

width: 100px

}
.v-leave-to {

width: 0

}
.v-leave-active {

transition: all 1s;

}
</style>
</head>

<body>
<div id= 'app'>
<button @click= 'change'>21</button>
<transition>
<div id= 'div' v-show= 'show'></div>
</transition>
</div>
</body>
<script>
new Vue({

el: '#app',
data:{
    show: true,
},
methods:{
    change() {
        this.show=!this.show;
    }
}

})
</script>

</html>vue過渡對寬高無效是不是bug請求正確的姿勢!!謝謝~~

回答
編輯回答
祈歡

不是vue的問題,你寫的transation效果太簡單了。

clipboard.png

官方建議用animate.css

2017年4月28日 09:27