GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - YikaJ/react-countdown: A component for React

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
lib
lib
 
 
src
src
 
 
.babelrc
.babelrc
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

react-countdown-time

A component for React

这是一个与UI无关的定时器,如何进行展示这取决于你。 react-countdown-time 只负责帮你计算并实时反馈定时器数据。

##获取该组件

$ npm install react-countdown-time --save

##代码实例:

import Countdown from 'react-countdown-time'
// 部分代码省略
<Countdown endTime={new Date("2016/6/5")} overText="活动已结束" onEnd={this.handleCountdownEnd}>
  {({d, h, m, s}) => {
    return (<span>还剩{d}天{h}时{m}分{s}秒</span>)
  }}
</Countdown>

我们可以看出,如何定义倒计时的样式是取决你的,组件仅提供了时间相关数据的回调,这也大大增大了组件的灵活性和应用场景。

##Receive Props

prop type description isRequired
endTime Date 结束时间 true
overText String 结束时的提示
onEnd Function 结束后的 Callback Hook

About

A component for React

Resources

Readme
Activity

Stars

4 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.