Это должно быть просто, но я не могу найти как. В этом примере при добавлении или удалении нового элемента я бы хотел, чтобы высота #app изменялась плавно, а не мгновенно.
В чистом виде css
Спасибо за помощь.
https://codesandbox.io/s/sparkling-frog-qfy64
<template>
<div id="app">
<button @click="addItem">Add</button>
<button @click="removeItem">Remove</button>
<div v-for="(item, i) in items" class="box" :key="i">BOX</div>
</div>
</template>
<script>
export default {
name: "App",
data: () => ({
items: [1, 1]
}),
methods: {
addItem() {
this.items.push(1);
},
removeItem() {
this.items.pop();
}
}
};
</script>
<style>
#app {
text-align: center;
color: white;
margin-top: 60px;
background: blue;
height: auto;
transition: all 1.5s ease;
}
.box {
padding: 15px;
}
</style>