├── .gitattributes ├── README.md └── VueJsCounter.vue /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue Js Counter 2 | 3 | 4 | ![altcenter](https://www.mustafacagri.com/wp-content/uploads/2020/10/VueJsCounter.gif "Vue Js Counter") 5 | 6 | 7 | With the Vue Js Counter, you can count up or down between two numbers. 8 | 9 | For example, you can count down from 2020 to 1980 or count up from 1900 to 1999. 10 | 11 | ## Setup 12 | 13 | ```npm install vue-js-counter``` 14 | 15 | ## Import 16 | ``` 24 | ``` 25 | 26 | ## Usage (Count Up) 27 | ``` 28 | 29 | ``` 30 | 31 | 32 | ## Simple Usage (Count Up) 33 | ``` 34 | 35 | ``` 36 | 37 | 38 | ## Usage (Count Down) 39 | ``` 40 | 41 | ``` 42 | 43 | ## Notes 44 | Only **end** attribute is required. The others are optional. 45 | 46 | If **start** attribute is not filled, Vue Js Counter understands that it will be count up to **end** value. 47 | 48 | If **end** is smaller than **start** value, it will be counted down **end** to **start**. 49 | 50 | 51 | 52 | ## Attributes 53 | `start (optional)`: The starting number. If you leave it blank, ***default value is 0***. 54 | 55 | **`end (required)`**: The ending number. 56 | 57 | `duration (optional)`: Specifies how long the count down / up will takes in millisecond. ***default value is 2000***. 58 | 59 | `thousand (optional)`: Specifies the character of the thousands separator. ***default value is . (dot)***. 60 | 61 | `thousand (optional)`: Specifies the character of the decimal separator. ***default value is , (comma)***. -------------------------------------------------------------------------------- /VueJsCounter.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | --------------------------------------------------------------------------------