XLL
XLL
  • 发布:2019-09-20 12:08
  • 更新:2021-07-03 09:11
  • 阅读:2804

nvue页面能做动画吗,如果能,怎么做,描述一下具体方法

分类:nvue
2019-09-20 12:08 负责人:无 分享
已邀请:
DCloud_uniAD_HDX

DCloud_uniAD_HDX

nvue 目前暂不支持 uni.createAnimation,先采用下面的方案
参考文档 https://weex.apache.org/zh/docs/modules/animation.html

<template>  
  <view class="wrapper">  
    <view ref="test" @click="move" class="box"></view>  
  </view>  
</template>  

<script>  
  const animation = weex.requireModule('animation')  
  const modal = weex.requireModule('modal')  

  export default {  
    methods: {  
      move () {  
        var testEl = this.$refs.test;  
        animation.transition(testEl, {  
          styles: {  
            color: '#FF0000',  
            transform: 'translate(250px, 100px)',  
            transformOrigin: 'center center'  
          },  
          duration: 800, //ms  
          timingFunction: 'ease',  
          delay: 0 //ms  
        }, function () {  
          modal.toast({ message: 'animation finished.' })  
        })  
      }  
    }  
  }  
</script>  

<style scoped>  
  .box {  
    width: 250px;  
    height: 250px;  
    background-color: #DDD;  
  }  
</style>
9***@qq.com

9***@qq.com - 非要验证吗

weex的文档,已经废了啊,apache都不保存了。weex已死,但weex还死不承认,我他妈。

6***@qq.com

6***@qq.com - 小明

bindingx也可以

该问题目前已经被锁定, 无法添加新回复