Countdown component for Vue 3. For Vue 2, check out the
v1
branch.
dist/
├── vue-countdown.js (UMD, default)
├── vue-countdown.min.js (UMD, compressed)
├── vue-countdown.esm.js (ECMAScript Module)
├── vue-countdown.esm.min.js (ECMAScript Module, compressed)
└── vue-countdown.d.ts (TypeScript Declaration File)
Using npm:
npm install vue@3 @chenfengyuan/vue-countdown@2
Using pnpm:
pnpm add vue@3 @chenfengyuan/vue-countdown@2
Using Yarn:
yarn add vue@3 @chenfengyuan/vue-countdown@2
Using CDN:
<script src="https://unpkg.com/vue@3"></script><!-- Vue.js is required -->
<script src="https://unpkg.com/@chenfengyuan/vue-countdown@2"></script>
import { createApp } from 'vue';
import VueCountdown from '@chenfengyuan/vue-countdown';
const app = createApp({});
app.component(VueCountdown.name, VueCountdown);
<vue-countdown :time="2 * 24 * 60 * 60 * 1000" v-slot="{ days, hours, minutes, seconds }">
Time Remaining:{{ days }} days, {{ hours }} hours, {{ minutes }} minutes, {{ seconds }} seconds.
</vue-countdown>
<!-- <span>Time Remaining:1 days, 23 hours, 59 minutes, 59 seconds.</span> -->
Same as Vue 3.
Maintained under the Semantic Versioning guidelines.