vue-countdown组件
vue-countdown组件
Main
dist/
├── vue-countdown.js (UMD)
├── vue-countdown.min.js (UMD, compressed)
├── vue-countdown.common.js (CommonJS, default)
└── vue-countdown.esm.js (ES Module)
Install
npm install @chenfengyuan/vue-countdown vue
In browser
<script src="/path/to/vue.js"></script> <script src="/path/to/vue-countdown.js"></script> <script>Vue.component(VueCountdown.name, VueCountdown);</script>
Usage
import Vue from 'vue';
import VueCountdown from '@chenfengyuan/vue-countdown';
Vue.component(VueCountdown.name, VueCountdown);
<countdown :time="2 * 24 * 60 * 60 * 1000"> <template slot-scope="props">Time Remaining:{{ props.days }} days, {{ props.hours }} hours, {{ props.minutes }} minutes, {{ props.seconds }} seconds.</template> </countdown> <!-- <span>Time Remaining:1 days, 23 hours, 59 minutes, 59 seconds.</span> -->