1.1.0 • Published 7 years ago
@160over90/vue-tweened-number v1.1.0
TweenedNumber
A component for tweening between numeric values.
Features
Allows you to tween any given numbers. You also have the ability to change CSS or invoke logic while the value is tweening or once the tweening is completed.
Events
This component allows two event hooks.
@updateallows you to execute logic while the value is tweening.@completeallows you to execute logic once the tweening is completed.
Example
<TweenedNumber
:value="number"
:duration="2000"
:easing="easing.bind()"
@update="update"
@complete="complete"
/>
...
methods: {
update() {
// Do something
},
complete() {
// Do something
},
},To get access to the original DOM event, use the special $event variable.
<TweenedNumber
:value="number"
:duration="2000"
:easing="easing.bind()"
@update="update($event)"
/>
...
methods: {
update(event) {
// eslint-disable-next-line no-console
console.log('updating', event);
},
},Props
tag (String, Default: 'span') The type of HTML element you want.
value (Number, Required) The value that you want to tween.
easing (String, Function, Default: TWEEN.Easing.Linear.None) What determines how Tween.js interpolates between values. For more information on Tween easing methods click here.
duration (Number, Default: 1000) How long you want the tweening to last.
Project setup
yarn installCompiles and hot-reloads for development
yarn run serveCompiles and minifies for production
yarn run buildLints and fixes files
yarn run lint1.1.0
7 years ago