mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Use transitions for 🙀
This commit is contained in:
parent
272ae52c73
commit
505aed4575
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h1>Nuxt Chat</h1>
|
<h1>Nuxt Chat</h1>
|
||||||
<ul>
|
<transition-group name="list" tag="ul">
|
||||||
<li v-for="message in messages">
|
<li v-for="(message, index) in messages" :key="index">
|
||||||
<component :is="message.component" :data="message.data"></component>
|
<component :is="message.component" :data="message.data"></component>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</transition-group>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -58,5 +58,13 @@ ul li {
|
|||||||
background: white;
|
background: white;
|
||||||
border: 1px #ddd solid;
|
border: 1px #ddd solid;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.list-enter-active, .list-leave-active {
|
||||||
|
transition: all 0.4s;
|
||||||
|
}
|
||||||
|
.list-enter, .list-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(20px);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user