提交 2d4c2821 编写于 作者: 6 6261244ee0f53859114f72b7

feat: todo 添加/删除 动画

上级 23736e4c
<template>
<ul class="todo-main">
<MyItem v-for="item in todos" :key="item.id" :item="item"></MyItem>
<transition-group name="todo-item">
<MyItem v-for="item in todos" :key="item.id" :item="item"></MyItem>
</transition-group>
</ul>
</template>
......@@ -35,4 +37,21 @@ export default {
padding-left: 5px;
margin-top: 10px;
}
.todo-item-enter-active {
animation: horizontal-move 0.1s linear;
}
.todo-item-leave-active {
animation: horizontal-move 0.1s linear reverse;
}
@keyframes horizontal-move {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册