animated-number-vue
Advanced tools
Comparing version
{ | ||
"name": "animated-number-vue", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,8 +0,8 @@ | ||
# animated-number-vue | ||
# animated-number-vue | ||
 [](https://travis-ci.org/Leocardoso94/animated-number-vue) [](https://www.jsdelivr.com/package/npm/animated-number-vue) | ||
 [](https://travis-ci.org/Leocardoso94/animated-number-vue) [](https://www.jsdelivr.com/package/npm/animated-number-vue) | ||
>A simple vue animated number for Vue2, using [anime](https://github.com/juliangarnier/anime). | ||
> A simple vue animated number for Vue2, using [anime](https://github.com/juliangarnier/anime). | ||
>Live demo [here](https://codesandbox.io/s/v68x95mo30) | ||
> Live demo [here](https://codesandbox.io/s/v68x95mo30) | ||
@@ -19,9 +19,9 @@  | ||
````vue | ||
```vue | ||
<template> | ||
<animated-number | ||
:value="value" | ||
:formatValue="formatToPrice" | ||
<animated-number | ||
:value="value" | ||
:formatValue="formatToPrice" | ||
:duration="300" | ||
/> | ||
/> | ||
</template> | ||
@@ -38,3 +38,3 @@ <script> | ||
value: 1000 | ||
} | ||
}; | ||
}, | ||
@@ -48,20 +48,21 @@ methods: { | ||
</script> | ||
```` | ||
``` | ||
[View demo here](https://codesandbox.io/s/v68x95mo30) | ||
[](https://codesandbox.io/s/v68x95mo30) | ||
## Props | ||
## Props | ||
Following `props` are used while initialization | ||
> Note : Only `value` is a required prop. Others are optional | ||
| Prop Name | Type | Description | | ||
|----------|------|--------------| | ||
| value `(required)`| [ Number, String] | number that will be animated | | ||
| duration `(optional)`| Number | the duration of animation | | ||
| delay `(optional)`| Number | the delay of animation | | ||
| easing `(optional)`| String | you can found all valid values [here](https://github.com/juliangarnier/anime#easing-functions) | | ||
| Prop Name | Type | Description | | ||
| --------------------- | ----------------- | ---------------------------------------------------------------------------------------------- | | ||
| value `(required)` | [ Number, String] | number that will be animated | | ||
| duration `(optional)` | Number | the duration of animation | | ||
| round `(optional)` | Number | remove decimals by rounding the value | | ||
| delay `(optional)` | Number | the delay of animation | | ||
| easing `(optional)` | String | you can found all valid values [here](https://github.com/juliangarnier/anime#easing-functions) | | ||
#### Callbacks props | ||
@@ -71,9 +72,9 @@ | ||
| Names | Types | Arguments | Info | ||
| --- | --- | --- | --- | ||
| formatValue | Function | value `Number` | A function that will manipulate the animated value | | ||
| update | Function| animation `Object` | Called at time = 0 | ||
| run | Function| animation `Object` | Called after delay is finished | ||
| begin | Function | animation `Object` | Called after animation delay is over | ||
| complete | Function | animation `Object` | Called only after all the loops are completed | ||
| Names | Types | Arguments | Info | | ||
| ----------- | -------- | ------------------ | -------------------------------------------------- | | ||
| formatValue | Function | value `Number` | A function that will manipulate the animated value | | ||
| update | Function | animation `Object` | Called at time = 0 | | ||
| run | Function | animation `Object` | Called after delay is finished | | ||
| begin | Function | animation `Object` | Called after animation delay is over | | ||
| complete | Function | animation `Object` | Called only after all the loops are completed | | ||
@@ -88,3 +89,2 @@ ### Format Value | ||
### Begin | ||
@@ -94,7 +94,4 @@ | ||
Check if the animation has begun with `myAnimation.began`, return `true` or `false`. | ||
### Run | ||
@@ -104,6 +101,4 @@ | ||
### Complete | ||
`complete()` is called once after the animation is finished. | ||
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
188305
1420.06%17
70%947
539.86%98
-4.85%