This package has been deprecated

Author message:

repeat

@choujiaojiao/vue-countdown-timer

0.1.0 • Public • Published

@choujiaojiao/vue-countdown

vue倒计时插件

vue2 license

vue-countdown是一个无依赖项的轻量级vue组件,轻松实现倒计时需求,摆脱时间函数烦恼。 支持SSR。

Try the demo

如何使用

yarn add vue-countdown
or
npm install vue-countdown

例子

<template>
  <Countdown :time="3666" format="hh:mm:ss" @on-end="onCountdownEnd">
    <template slot-scope="{ time }">{{ time }}</template>
  </Countdown>
</template>

<script>
  import Countdown from 'vue-count-to'
  
  export default {
    components: { Countdown },
    methods: {
      onCountdownEnd() {
        console.log('countdown end~')
      }
    }
  }
</script>

属性

Property Description type default
time 倒计时时间差(单位:秒) Number 0
step 多久执行一次倒计时(单位:秒) Number 1s
switch 倒计时开关 Boolean - -
format 格式化 String - -

方法

Function Name Description
on-end 倒计时结束回调
on-countdown 每次倒计时回调

Package Sidebar

Install

npm i @choujiaojiao/vue-countdown-timer

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

1.15 MB

Total Files

12

Last publish

Collaborators

  • npm