【发布时间】:2020-11-05 03:02:11
【问题描述】:
当它变大时我做了一个盒子过渡,我如何让它在关闭时仍然具有相同的过渡效果,因为它会急剧关闭。
<template>
<div class="hello">
<div @click="biggerbox = !biggerbox;" class="box" :class="{'biggerbox':biggerbox}"></div>
</div>
</template>
<script>
export default {
name: "HelloWorld",
data() {
return {
biggerbox: false
};
}
};
</script>
<style scoped>
.box {
background-color: red;
height: 80px;
width: 90px;
}
.biggerbox {
background-color: red;
height: 180px;
width: 190px;
display: flex;
transition-duration: 1s;
transition-timing-function: ease;
}
</style>
这是代码沙盒的链接 https://codesandbox.io/s/focused-dew-0pm34?file=/src/components/HelloWorld.vue:338-582
【问题讨论】:
标签: javascript html css vue.js css-transitions