New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vuejs-countdown-timer

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuejs-countdown-timer

Vue 2 countdown and timer component

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
721
decreased by-45.42%
Maintainers
1
Weekly downloads
 
Created
Source

Vue-countdown-timer Component

Build Status Github starts License Npm downloads

一 Vue 2 countdown and timer component

Installation

npm i vuejs-countdown-timer -S

Usage

Support

Supported PackageVersion
Vue2.5+

Install component

Javascript

// global register
import VueCountdownTimer from 'vue-countdown-timer'
Vue.use(VueCountdownTimer)

// defalut install
Vue.use(VuePhotoswipe)

// or for a single instance
import VueCountdownTimer from 'vue-countdown-timer'

components: {
    VueCountdownTimer
},
methods: {
  countDownS_cb: function (x) {
    console.log(x)
  },
  countDownE_cb: function (x) {
    console.log(x)
  }
}

Vue template

<vue-countdown-timer
  @start_callback="startCallBack('活动开始')"
  @end_callback="endCallBack('活动结束')"
  :current-time="1481450106"
  :start-time="1481450110"
  :end-time="1481450115"
  :tip-text="'距离开始文字1'"
  :tip-text-end="'距离结束文字1'"
  :end-text="'结束自定义文字2'"
  :day-txt="'天'"
  :hour-txt="'小时'"
  :minutes-txt="'分钟'"
  :seconds-txt="'秒'">
</vue-countdown-timer>

Props

  1. currentTime - 当前时间戳,如果不传,默认获取用户本地的时间(建议传服务器的当前时间)
    • type: Number
    • required : false
    • default : ( new Date() ).getTime()
  2. startTime - 开始时间戳
    • type: Number
    • required : true
  3. endTime - 结束时间戳
    • type: Number
    • required : true
  4. tipText - 开始倒计时之前的提示文字
    • type: String
    • required : false
    • default : 距离开始
  5. tipTextEnd - 开始倒计时之后的提示文字
    • type: String
    • required : false
    • default : 距离结束
  6. endText - 倒计时结束之后的提示文字
    • type: String
    • required : false
    • default : 已结束
  7. dayTxt - 自定义显示的天数文字
    • type: String
    • required : false
    • default : :
  8. hourTxt - 自定义显示的小时文字
    • type: String
    • required : false
    • default : :
  9. secondsTxt - 自定义显示的分钟文字
    • type: String
    • required : false
    • default : :
  10. secondsFixed - 自定义显示的秒数文字
    • type: String
    • required : false
    • default : :

Events

  1. start_callback - 开始倒计时结束之后的回调方法
    • type: Function
    • required : false
  2. end_callback - 活动倒计时结束之后的回调方法
    • type: Function
    • required : false

Liscense

MIT License

Copyright (c) 2018 TriDiamond

Keywords

FAQs

Package last updated on 29 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc