Easy, customizable and automatic tweening is well rendered in range-bound slots. VueTweezing works with any tweening engine and provides easy integration with some engines like tween.js
and Tweezer
.
Passing tweening options: Any prop passed to Tweezing different from tween and to will be considered an option and passed.
How to make use of it:
1. Install it as a plugin:
import { Tweezing, tweezerHelper } from 'vue-tweezing' // import Tweezer to use it as our Tweening engine import Tweezer from 'tweezer.js' // install the plugin with as many engines as you want // use the tweezerHelper to generate the function // needed by VueTweezing to handle tweezing Vue.use(Tweezing, { tweezer: tweezerHelper(Tweezer), })
2. Use it as a component:
<Tweezing ref="tweezing" :to="value" duration="500" @end="doSomething"> <pre slot-scope="tweenedValue"> target: {{ value }} val: {{ tweenedValue }} </pre> </Tweezing>
3. Change the value as you normally would:
const vm = new Vue({ el: '#app', data: { value: 0, }, }) // somewhere else vm.value = 200
4. You can play with a tweened object by accessing the tween
property in the Tweening component:
// given the example above vm.$refs.tweezing.$tween.stop()
automatic tweening engine for vue, VueTweezing Plugin/Github
See Demo And Download
Official Website(posva): Click Here
This superior jQuery/javascript plugin is developed by posva. For extra advanced usage, please go to the official website.