{"id":17784918,"url":"https://github.com/realgeoffrey/react-time-countdown","last_synced_at":"2025-03-16T04:30:49.451Z","repository":{"id":42474159,"uuid":"422179312","full_name":"realgeoffrey/react-time-countdown","owner":"realgeoffrey","description":"倒计时（React组件）","archived":false,"fork":false,"pushed_at":"2023-06-20T13:38:26.000Z","size":569,"stargazers_count":8,"open_issues_count":11,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-27T05:04:03.004Z","etag":null,"topics":["countdown-timer","countdowntimer","react"],"latest_commit_sha":null,"homepage":"https://realgeoffrey.github.io/react-time-countdown/demo/index.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/realgeoffrey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-28T11:35:07.000Z","updated_at":"2024-05-06T03:02:42.000Z","dependencies_parsed_at":"2023-02-08T04:16:50.921Z","dependency_job_id":null,"html_url":"https://github.com/realgeoffrey/react-time-countdown","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realgeoffrey%2Freact-time-countdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realgeoffrey%2Freact-time-countdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realgeoffrey%2Freact-time-countdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realgeoffrey%2Freact-time-countdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/realgeoffrey","download_url":"https://codeload.github.com/realgeoffrey/react-time-countdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243802944,"owners_count":20350316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["countdown-timer","countdowntimer","react"],"created_at":"2024-10-27T08:22:13.516Z","updated_at":"2025-03-16T04:30:49.015Z","avatar_url":"https://github.com/realgeoffrey.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-time-countdown\n\nReact的倒计时组件\n\n1. npm：\u003chttps://www.npmjs.com/package/react-time-countdown\u003e\n2. demo：\u003chttps://realgeoffrey.github.io/react-time-countdown/demo/index.html\u003e\n\n### 安装-引用\n1. Node.js\n\n    ```shell\n    npm install react-time-countdown --save\n    ```\n\n    ```tsx\n    import TimeCountdown from 'react-time-countdown'\n    ```\n2. 浏览器\n\n    ```html\n    \u003c!-- 需要先引入react技术栈：\n        \u003cscript src='//unpkg.com/react@18/umd/react.production.min.js'\u003e\u003c/script\u003e\n        \u003cscript src='//unpkg.com/react-dom@18/umd/react-dom.production.min.js'\u003e\u003c/script\u003e\n\n        \u003cscript src='//unpkg.com/babel-standalone@6/babel.min.js'\u003e\u003c/script\u003e\n    --\u003e\n    \u003cscript src=\"//unpkg.com/react-time-countdown\"\u003e\u003c/script\u003e\n\n    \u003cscript\u003e\n    const TimeCountdown = window['react-time-countdown'].default\n    \u003c/script\u003e\n    ```\n\n### 用法\n\n```tsx\n\u003cTimeCountdown\n  deadlineTimestamp={结束时间戳（必填）}\n  callback={() =\u003e {\n    // 倒计时结束时执行的回调函数\n  }}\n  leftMillisecond={提前到期的毫秒数（0）}\n  renderMillisecond={(millisecond: number): React.ReactNode =\u003e {\n    // 参数：倒计时还剩下多少毫秒\n    // 返回：渲染本组件\n  }}\n  intervalDelay={每次调用渲染的间隔时间，毫秒（1000）}\n/\u003e\n```\n\n### 开发调试\n```shell\n# 监听改变\nyarn start\n\n# 运行开发demo\ncd dev\nyarn start\n```\n\n```shell\n# 构建生产环境文件\nyarn build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealgeoffrey%2Freact-time-countdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealgeoffrey%2Freact-time-countdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealgeoffrey%2Freact-time-countdown/lists"}