# @ludis/vue-countdown

> Countdown component for Vue.js.

Latest version **1.0.0** (published 2018-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ludis/vue-countdown
pnpm add @ludis/vue-countdown
yarn add @ludis/vue-countdown
bun add @ludis/vue-countdown
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-11-02 |
| First published | 2018-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 126.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ludis |
| Maintainers | ludis |
| Keywords | countdown, component, vue-component, html, css, javascript, front-end, web |

## Links

- npm: https://www.npmjs.com/package/@ludis/vue-countdown
- Repository: https://github.com/flute/vue-countdown
- Homepage: https://flute.github.io/vue-countdown
- Issues: https://github.com/flute/vue-countdown/issues
- npm.io page: https://npm.io/package/@ludis/vue-countdown

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-11-02

## README

### vue-countdown

Countdown component for Vuejs 2.x.

Website: https://flute.github.io/vue-countdown

### 目录

```
.
├── dist
│   ├── countdown.common.js     (CommonJS, default)
│   ├── countdown.umd.js        (UMD)
│   ├── countdown.umd.min.js    (UMD, compressed)
└── src
    └── index.js // 源码
```

### 安装

```
npm install @flute/vue-countdown vue
```

浏览器:

```js
<script src="/path/to/vue.js"></script>
<script src="/path/to/vue-countdown.js"></script>
<script>Vue.component(VueCountdown.name, VueCountdown);</script>
```

### 使用

```js
import Vue from 'vue';
import VueCountdown from '@flute/vue-countdown';

Vue.component(VueCountdown.name, VueCountdown);

<VueCountdown
  notOpenTip="距离开始还剩："
  openingTip="距离结束还剩："
  closedTip="已结束"
  :duration="1*60"
  @start="startHandler"
  @end="endHandler"
  startTime="2018-11-01 20:35:00">
  <template slot="tip" scope="props">
    {{props.tip}}
  </template>
  <template slot="countdown" scope="props">
    {{props.days}}天{{props.hours}}小时{{props.minutes}}分钟{{props.seconds}}秒
  </template>
</VueCountdown>

<!--
开始前：
<div>
  距离开始还剩: 01天01小时11分钟11秒
</div>

进行中：
<div>
  距离结束还剩: 01天01小时11分钟11秒
</div>

已结束：
<div>
  已结束: 00天00小时00分钟00秒
</div>
-->
```

更多使用案例参考： https://flute.github.io/vue-countdown

### Attributes


| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| --- | --- | --- | --- | --- |
| startTime | 倒计时的开始时间 | Date/string/number | 可被`new Date()`解析：js Date类型，或字符串日期如: '2018-11-02 14:00:00'，或时间戳如: 1541138400000  | - |
| endTime | 可选，倒计时的结束时间。和duration二选一，当填写endTime时，duration失效 | Date/string/number | 同startTime | - |
| duration | 可选，倒计时持续时间，单位为秒。和duration二选一，当填写endTime时，duration失效 | number | - | - |
| currentTime | 可选，当前时间，默认为本地时间 | Date/string/number | 同startTime | new Date() |
| notOpenTip | 可选，为开始前的提示 | string | - | "Left at the beginning:" |
| openingTip | 可选，进行中的提示 | string | - | "Left at the end:" |
| closedTip | 可选，结束后的提示 | string | - | "Over:" |

### Events


| 事件名称 | 说明 | 回调参数 |
| --- | --- | --- |
| start | 当倒计时开始时触发 | 无 |
| end | 当倒计时结束时触发 | 无 |

---
_Source: https://npm.io/package/@ludis/vue-countdown · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
