小程序动画

<view class="image_zone" animation="{{animationData}}"/>
 
复制代码
const utils = require('../../../../../utils/index');
// pages/experience/more/component/moreSwiper3/moreSwiper3.js
Component({/**
   * 组件的初始数据
   */
  data: {
    animationData: {}
  },

  /**
   * 组件的方法列表
   */
  methods: {

    change() {
      // 旋转动画
      this.animation.scale(0).step().scale(1).step()
      this.setData({
        animationData: this.animation.export()
      })
      // 旋转动画end
    }
  },

  /**
   * 组件的方法列表
   */
  //在组件实例进入页面节点树时执行
  attached() {
    this.animation = wx.createAnimation({
      duration: 300,
      timingFunction: 'ease',
    })
  }
})
复制代码

 

posted @   Magi黄元  阅读(80)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
点击右上角即可分享
微信分享提示