Dimples's blog Dimples's blog
首页
  • 前端随笔

    • React
  • 系列文章

    • 《ES6 教程》笔记
    • 《Vue》笔记
    • 《TypeScript》笔记
  • 后端文章

    • Java
    • Python
    • 数据库
  • 学习笔记

    • 《Rust》笔记
    • 《SpringBoot》笔记
    • 《Django》笔记
    • 《Docker》笔记
    • 《Python爬虫》笔记
技术分享
友情链接
索引
关于
GitHub (opens new window)

DimplesY

不会写代码
首页
  • 前端随笔

    • React
  • 系列文章

    • 《ES6 教程》笔记
    • 《Vue》笔记
    • 《TypeScript》笔记
  • 后端文章

    • Java
    • Python
    • 数据库
  • 学习笔记

    • 《Rust》笔记
    • 《SpringBoot》笔记
    • 《Django》笔记
    • 《Docker》笔记
    • 《Python爬虫》笔记
技术分享
友情链接
索引
关于
GitHub (opens new window)
  • 基础

  • 组件

  • 过渡&动画

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

  • 工具

  • 规模化

  • Vuex

  • Vue小技巧

  • 其他

  • 《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)
#Vue
上次更新: 2022/11/20, 18:28:09
使用animate库
Mixin混入

← 使用animate库 Mixin混入→

最近更新
01
使用 strapi 快速构建 API 和 CMS 管理系统
03-03
02
Rust 开发环境
11-26
03
使用 paka.dev 为 npm 包生成文档
11-24
更多文章>
Theme by Vdoing | Copyright © 2020-2025 Dimples YJ | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式