{"id":19382446,"url":"https://github.com/bennyxguo/vuejs-countdown-timer","last_synced_at":"2025-12-29T14:24:26.358Z","repository":{"id":43482716,"uuid":"146074846","full_name":"bennyxguo/vuejs-countdown-timer","owner":"bennyxguo","description":"⏱ Vue 2 event countdown and timer component","archived":false,"fork":false,"pushed_at":"2024-08-28T02:51:15.000Z","size":85,"stargazers_count":49,"open_issues_count":9,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T20:04:41.683Z","etag":null,"topics":["countdown-timer","event-countdown","vue-component","vue2","vuejs2"],"latest_commit_sha":null,"homepage":"https://gh.bennyxguo.com/vuejs-countdown-timer/","language":"HTML","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/bennyxguo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-25T07:20:11.000Z","updated_at":"2025-03-18T19:40:45.000Z","dependencies_parsed_at":"2024-11-15T09:15:47.228Z","dependency_job_id":null,"html_url":"https://github.com/bennyxguo/vuejs-countdown-timer","commit_stats":null,"previous_names":["tridiamond/vuejs-countdown-timer"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyxguo%2Fvuejs-countdown-timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyxguo%2Fvuejs-countdown-timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyxguo%2Fvuejs-countdown-timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyxguo%2Fvuejs-countdown-timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bennyxguo","download_url":"https://codeload.github.com/bennyxguo/vuejs-countdown-timer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250509794,"owners_count":21442498,"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","event-countdown","vue-component","vue2","vuejs2"],"created_at":"2024-11-10T09:21:24.567Z","updated_at":"2025-12-29T14:24:26.329Z","avatar_url":"https://github.com/bennyxguo.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://tridiamond.tech\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg width=\"100\" src=\"https://img-blog.csdnimg.cn/20200930013332450.png\" alt=\"TriDiamond logo\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eVue-countdown-timer Component\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eVue 2 countdown and timer component \u003cbr\u003e\n  —— Made with ❤️ by \u003ca href=\"https://github.com/TriDiamond\"\u003eTriDiamond\u003c/a\u003e\u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://circleci.com/gh/bennyxguo/vuejs-countdown-timer/tree/master\"\u003e\n      \u003cimg src=\"https://img.shields.io/circleci/project/github/bennyxguo/vuejs-countdown-timer.svg\" alt=\"Build Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/bennyxguo/vuejs-countdown-timer/stargazers\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/stars/bennyxguo/vuejs-countdown-timer.svg\" alt=\"Github starts\"\u003e\n    \u003c/a\u003e\n    \u003ca\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/bennyxguo/vuejs-countdown-timer.svg\" alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/vuejs-countdown-timer\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/dt/vuejs-countdown-timer.svg\" alt=\"Npm downloads\"\u003e\n    \u003c/a\u003e\n    \u003ca\u003e\n      \u003cimg src=\"https://img.shields.io/npm/v/vuejs-countdown-timer.svg\" alt=\"Npm version\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\n[Demo](https://bennyxguo.github.io/vuejs-countdown-timer/)\n[📙 中文文档](https://github.com/bennyxguo/vuejs-countdown-timer/blob/master/README_CN.md)\n[📙Changelog](https://github.com/bennyxguo/vuejs-countdown-timer/blob/master/CHANGELOG.md)\n\n\u003c/div\u003e\n\n## Installation\n\n```bash\nnpm i vuejs-countdown-timer -S\n```\n\n## Usage\n\n### Support\n\n| Supported Package | Version |\n| ----------------- | ------- |\n| Vue               | 2.5+    |\n\n### Install component and Usage\n\nImport component\n\n```es6\n// global register at main.js\nimport VueCountdownTimer from 'vuejs-countdown-timer';\nVue.use(VueCountdownTimer);\n```\n\nVue default template\n\n```vue\n\u003ctemplate\u003e\n    \u003cvue-countdown-timer\n      @start_callback=\"startCallBack('event started')\"\n      @end_callback=\"endCallBack('event ended')\"\n      :start-time=\"'2018-10-10 00:00:00'\"\n      :end-time=\"1481450115\"\n      :interval=\"1000\"\n      :start-label=\"'Until start:'\"\n      :end-label=\"'Until end:'\"\n      label-position=\"begin\"\n      :end-text=\"'Event ended!'\"\n      :day-txt=\"'days'\"\n      :hour-txt=\"'hours'\"\n      :minutes-txt=\"'minutes'\"\n      :seconds-txt=\"'seconds'\"\u003e\n    \u003c/vue-countdown-timer\u003e\n\u003c/template\u003e\n\n\u003cscript \u003e\nexport default {\n  name: 'Timer',\n  methods: {\n    startCallBack: function(x) {\n      console.log(x);\n    },\n    endCallBack: function(x) {\n      console.log(x);\n    },\n  },\n};\n\u003c/script\u003e\n```\n\nVue Customized template\n\n```vue\n\u003ctemplate\u003e\n    \u003cvue-countdown-timer\n      @start_callback=\"startCallBack('event started')\"\n      @end_callback=\"endCallBack('event ended')\"\n      :start-time=\"'2018-10-10 00:00:00'\"\n      :end-time=\"1481450115\"\n      :interval=\"1000\"\n      :start-label=\"'Until start:'\"\n      :end-label=\"'Until end:'\"\n      label-position=\"begin\"\n      :end-text=\"'Event ended!'\"\n      :day-txt=\"'days'\"\n      :hour-txt=\"'hours'\"\n      :minutes-txt=\"'minutes'\"\n      :seconds-txt=\"'seconds'\"\u003e\n      \u003ctemplate slot=\"start-label\" slot-scope=\"scope\"\u003e\n        \u003cspan style=\"color: red\" v-if=\"scope.props.startLabel !== '' \u0026\u0026 scope.props.tips \u0026\u0026 scope.props.labelPosition === 'begin'\"\u003e{{scope.props.startLabel}}:\u003c/span\u003e\n        \u003cspan style=\"color: blue\" v-if=\"scope.props.endLabel !== '' \u0026\u0026 !scope.props.tips \u0026\u0026 scope.props.labelPosition === 'begin'\"\u003e{{scope.props.endLabel}}:\u003c/span\u003e\n      \u003c/template\u003e\n\n      \u003ctemplate slot=\"countdown\" slot-scope=\"scope\"\u003e\n        \u003cspan\u003e{{scope.props.days}}\u003c/span\u003e\u003ci\u003e{{scope.props.dayTxt}}\u003c/i\u003e\n        \u003cspan\u003e{{scope.props.hours}}\u003c/span\u003e\u003ci\u003e{{scope.props.hourTxt}}\u003c/i\u003e\n        \u003cspan\u003e{{scope.props.minutes}}\u003c/span\u003e\u003ci\u003e{{scope.props.minutesTxt}}\u003c/i\u003e\n        \u003cspan\u003e{{scope.props.seconds}}\u003c/span\u003e\u003ci\u003e{{scope.props.secondsTxt}}\u003c/i\u003e\n      \u003c/template\u003e\n\n      \u003ctemplate slot=\"end-label\" slot-scope=\"scope\"\u003e\n        \u003cspan style=\"color: red\" v-if=\"scope.props.startLabel !== '' \u0026\u0026 scope.props.tips \u0026\u0026 scope.props.labelPosition === 'end'\"\u003e{{scope.props.startLabel}}:\u003c/span\u003e\n        \u003cspan style=\"color: blue\" v-if=\"scope.props.endLabel !== '' \u0026\u0026 !scope.props.tips \u0026\u0026 scope.props.labelPosition === 'end'\"\u003e{{scope.props.endLabel}}:\u003c/span\u003e\n      \u003c/template\u003e\n\n      \u003ctemplate slot=\"end-text\" slot-scope=\"scope\"\u003e\n        \u003cspan style=\"color: green\"\u003e{{ scope.props.endText}}\u003c/span\u003e\n      \u003c/template\u003e\n    \u003c/vue-countdown-timer\u003e\n\u003c/template\u003e\n\n\u003cscript \u003e\nexport default {\n  name: 'Timer',\n  methods: {\n    startCallBack: function(x) {\n      console.log(x);\n    },\n    endCallBack: function(x) {\n      console.log(x);\n    },\n  },\n};\n\u003c/script\u003e\n```\n\n### Slots\n\n| Slot name   | Description           |\n| ----------- | --------------------- |\n| start-label | Timer start label     |\n| countdown   | Timer countdown label |\n| end-label   | Timer end label       |\n| end-text    | Timer ended text      |\n\n### `start-label` Scoped Slot\n\n| Slot scope name | Description                                                              |\n| --------------- | ------------------------------------------------------------------------ |\n| startLabel      | Event begin label text                                                   |\n| endLabel        | Event end label text                                                     |\n| tips            | Tips `true` means countdown till start, `false` means countdown till end |\n| labelPosition   | event label position, `'begin'` or `'end'`                               |\n\n### `countdown` Scoped Slot\n\n| Slot scope name | Description                                        |\n| --------------- | -------------------------------------------------- |\n| days            | Number of days till event                          |\n| dayTxt          | Day label                                          |\n| hours           | Number of hours till event                         |\n| hourTxt         | Hours label                                        |\n| minutes         | Number of minutes till event                       |\n| minuteTxt       | Minutes label                                      |\n| seconds         | Number of seconds till event                       |\n| secondTxt       | Seconds label                                      |\n| showDay         | display status of day countdown number and text    |\n| showHour        | display status of hour countdown number and text   |\n| showMinute      | display status of minute countdown number and text |\n\n### `end-label` Scoped Slot\n\n| Slot scope name | Description                                                              |\n| --------------- | ------------------------------------------------------------------------ |\n| startLabel      | Event begin label text                                                   |\n| endLabel        | Event end label text                                                     |\n| tips            | Tips `true` means countdown till start, `false` means countdown till end |\n| labelPosition   | event label position, `'begin'` or `'end'`                               |\n\n### `end-text` Scoped Slot\n\n| Slot scope name | Description      |\n| --------------- | ---------------- |\n| endText         | Timer ended text |\n\n### Props\n\n**start-time**\n\n- `type`: Number|String\n- `required` : true\n\n**end-time**\n\n- `type`: Number|String\n- `required` : true\n\n**interval**\n\n- `type`: Number\n- `required` : false\n- `default` : 1000\n\n**start-label**\n\n- `type`: String\n- `required` : false\n- `default` : ''\n\n**end-label**\n\n- `type`: String\n- `required` : false\n- `default` : ''\n\n**label-position** - begin (before countdown) / end (after countdown)\n\n- `type`: String\n- `required` : false\n- `default` : 'begin'\n\n**end-text**\n\n- `type`: String\n- `required` : false\n- `default` : 'Event ended!'\n\n**day-txt** - if pass `null`, this unit will be hidden\n\n- `type`: String\n- `required` : false\n- `default` : ':'\n\n**hour-txt** - if pass `null`, this unit will be hidden\n\n- `type`: String\n- `required` : false\n- `default` : ':'\n\n**seconds-txt** - if pass `null`, this unit will be hidden\n\n- `type`: String\n- `required` : false\n- `default` : ':'\n\n**seconds-fixed**\n\n- `type`: String\n- `required` : false\n- `default` : ':'\n\n**show-zero** - display status of 00\n\n- `type`: Boolean\n- `required` : false\n- `default` : true\n\n### Events\n\n**start_callback** - Event started callback\n\n- `type`: Function\n- `required` : false\n\n**end_callback** - Event ended callback\n\n- `type`: Function\n- `required` : false\n\nIf the `end-time` prop is dynamically generated or 'computed', the initial value will be `NaN`. This will trigger the `end_callback` function, which might not be desirable. This can be solved by declaring it this way:\n\n```vue\n\u003ctemplate\u003e\n  \u003cvue-countdown-timer\n    ...\n    :end-time=\"end_at?end_at:endAt\"\n    ...\n    \u003e\u003c/vue-countdown-timer\u003e\n\u003c/template\u003e\n\u003cscript\u003e\n  data() {\n      return {\n          endAt:  (new Date).getTime()+5000\n      }\n  }\n\u003c/script\u003e\n```\n\nWhere `end_at` is the computed value, and `endAt` is a default value.\n\n# Liscense\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennyxguo%2Fvuejs-countdown-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbennyxguo%2Fvuejs-countdown-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennyxguo%2Fvuejs-countdown-timer/lists"}