liuhann / vue-anime

Vue timeline animation using http://animejs.com/
23 stars 2 forks source link

Question. Dynamic prop #1

Open denis-gorin opened 6 years ago

denis-gorin commented 6 years ago

hi is it possible to have dynamic property for Object Animation?

liuhann commented 6 years ago

vue-anime is based on animejs which require to specify the 'begin' and 'end' value of something numeric and do the transformation based on easing function

would you provide more information?

gerwinov commented 6 years ago

I also ran into this issue when creating an animation.

I'm trying to do something like this: <vue-anime :animate="animationProps" ....

  data() {
    return {
      animationProps: {
        translateX: 250
      }
    }
  }

And than change the translateX property when needed and play the animation again with this.$refs.XXX.play(). This however seems not to work, the animation is only played with the initial value. This would make a nice enhancement.

liuhann commented 6 years ago

Hi You can change animationProps to work!

and if you only set animationProps.translateX, call reset() method to reset animation