npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ludis/vue-countdown

v1.0.0

Published

Countdown component for Vue.js.

Downloads

6

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

浏览器:

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

使用

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 | 当倒计时结束时触发 | 无 |