小冷学习笔记 小冷学习笔记
首页
分类
标签
归档
  • 图片生成工具 (opens new window)
  • 在线画图工具 (opens new window)
  • favicon生成工具 (opens new window)
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
关于
GitHub (opens new window)

王金海

后端界的小哥哥,一个独立开发者,折腾在 0 和 1 世界的小哥哥;一个终身学习者,誓将学习无限循环. 希望结识可以共同成长的小伙伴
首页
分类
标签
归档
  • 图片生成工具 (opens new window)
  • 在线画图工具 (opens new window)
  • favicon生成工具 (opens new window)
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
关于
GitHub (opens new window)
  • 基础

  • 组件

  • 过渡&动画

    • transition过渡&动画
    • 使用animate库
    • transition-group列表过渡
      • 列表的进入/离开过渡
      • 列表的排序过渡
  • 可复用性&组合

  • 工具

  • 规模化

  • Vuex

  • 其他

  • 《Vue》笔记
  • 过渡&动画
xugaoyi
2020-02-04
目录

transition-group列表过渡

# transition-group列表过渡

# 列表的进入/离开过渡

<transition-group tag="ul"> <!--tag转为ul-->
    <li v-for="item in list" :key="item">{{item}}</li> <!--子元素要有key-->
</transition-group>
1
2
3

注意:列表元素一定要有key

.v-enter,.v-leave-to{
  opacity: 0;
  transform: translateX(30px);
}
.v-enter-active,.v-leave-active{
  transition: all 1s;
}
1
2
3
4
5
6
7

See the Pen vue列表过渡 by xugaoyi (@xugaoyi) on CodePen.

# 列表的排序过渡

.v-move {
  transition: transform 1s;
}
1
2
3

See the Pen vue列表过渡-排序过渡 by xugaoyi (@xugaoyi) on CodePen.

列表过渡&排序过渡

See the Pen vue列表过渡&排序过渡 by xugaoyi (@xugaoyi) on CodePen.

编辑 (opens new window)
上次更新: 2021/01/24, 15:14:51
使用animate库
Mixin混入

← 使用animate库 Mixin混入→

Theme by Vdoing | Copyright © 2021-2022 小冷学习笔记 | 陕ICP备18004547号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式
×