vue 倒计时插件
真棒倒计时 (vue-awesome-countdown)
Countdown plug-in with high performance and high accuracy for Vue2.5.0+.
适用于Vue2.5.0 +的高性能和高精度倒计时插件。
安装 (Installation)
Install
安装
$ npm install vue-awesome-countdown --save
# or
$ yarn add vue-awesome-countdown
...and import and use the plugin like so:
...然后像这样导入和使用插件:
import vueAwesomeCountdown from 'vue-awesome-countdown'
Vue.use(vueAwesomeCountdown, 'vac') // Component name, `countdown` and `vac` by default
用法 (Usage)
<countdown :end-time="new Date().getTime() + 60000">
<span
slot="process"
slot-scope="anyYouWantedScopName">{
{ `Lefttime: ${anyYouWantedScopName.timeObj.ceil.s}` }}</span>
<span slot="finish">Done!</span>
</countdown>
<vac :end-time="new Date().getTime() + 60000">
<span
slot="process"
slot-scope="{ timeObj }">{
{ `Lefttime: ${timeObj.m}:${timeObj.s}` }}</span>
<span slot="finish">Done!</span>
</vac>