0.0.5 • Published 7 years ago

vuejs-count-down v0.0.5

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

vuejs-count-down

Vue.js countdown component

Getting started

Installation

npm install --save vuejs-count-down

Usage

  • 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 -->

Props

time

  • Type: Number
  • Required

Total number of time in seconds for the countdown.

autoStart

  • Type: Boolean
  • Default: true

Start countdown automatically when the component is created.

Methods

start

Start the countdown.

stop

Stop the countdown.

restart

Init the countdown and start again.

Events

onProgress

This event fires in progress (each second)

onFinish

This event fires when countdown ends.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email . instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago