Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

c-vue-countdown

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c-vue-countdown

a simple countdown abort vue component

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

#use

template

     <countdown
        class="times"
        :startTime="startTime"
        :endTime="endTime"
        :format="format"
        @change="chountChange"
        @end="end"
    />
     内进行付款,若未进行支付则订单自动取消。

js
this.format = "{yy}{mn}月{dd}天{hh}小时{mm}分钟{ss}秒";
this.startTime =  new Date().getTime();
this.endTime = this.startTime + 60*1000*60*24*3000

chountChange({ dd, hh, mm, ss,ms,yy}) {
    let str = "{dd}天{hh}小时{mm}分钟{ss}秒";
    if (dd == 0) str = "{hh}小时{mm}分钟{ss}秒";
    if (hh == 0 && dd == 0) str = "{mm}分钟{ss}秒"
    if (mm == 0 && hh == 0 && dd == 0) str = "{ss}秒";
    if (str != this.format) this.format = str;
}
end(){

}
prop & event
startTime默认本地当前时间戳开始时间
endTime毫秒结束时间
format"{yy}年{mn}月{dd}天{hh}小时{mm}分钟{ss}秒"剩余时间 按照当前最高时间单位解析 1月10天10小时 == {mn}月{dd}天{hh}小时 和 (如果是6月份)40天10小时=={dd}天{hh}小时 是相同的
change每次计算的回调 1000毫秒 通知一次 这个可以随时更改所有的属性
end倒计时结束

Keywords

FAQs

Package last updated on 09 Apr 2021

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