vue 数字动画递增_Vue.js 列表过渡

进入/离开 & 列表过渡

示例一:

点击

侠课岛-vue动画课程

1061cfbac0918d2fe49f65adea47e3a4.png

示例二:

添加与删除数字动画修改

 侠课岛 vue-列表动画
添加数字 删除数字 {{ item }}
var vm = new Vue({ el: '#main', data: { items: [1, 2, 3, 4, 5, 6, 7, 8, 9], nextNum: 10 }, methods: { // 定义一个随机添加的方法 randomIndex: function() { return Math.floor(Math.random() * this.items.length) }, // 添加数字方法 add: function() { this.items.splice(this.randomIndex(), 0, this.nextNum++) }, // 删除数字方法 remove: function() { this.items.splice(this.randomIndex(), 1) }, } });
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值