Vue.js countdown component
npm install --save vuejs-count-down
- CommonJS:
var CountDown = require('vuejs-count-down') - ES2015:
import CountDown from 'vuejs-count-down'
components: {
CountDown,
},
methods: {
countDownProgress(time) {
this.countDownSeconds = time
},
countDownFinished() {
// restart when countdown ends
this.$refs.countdown.$emit('restart')
}
}<CountDown
ref="countdown"
:time="30"
@onProgress="countDownProgress"
@onFinish="countDownFinished"
>
Time Remaining: {{countDownSeconds}} seconds.
</CountDown>
<!-- Time Remaining:30 seconds -->- Type:
Number - Required
Total number of time in seconds for the countdown.
- Type:
Boolean - Default:
true
Start countdown automatically when the component is created.
Start the countdown.
Stop the countdown.
Init the countdown and start again.
This event fires in progress (each second)
This event fires when countdown ends.
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email . instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.