countdown-f
Version:
一个用vue封装的倒计时组件
51 lines (43 loc) • 915 B
Markdown
# countdown
## Project setup
```
npm install countdown-f //下载包文件
```
### Reference and register
```
import Countdown from "countdown-f";
import "../node_modules/countdown-f/count-down.css";
Vue.use(Countdown);
```
### use components
```
<template>
<div id="app">
<CountDown :time="8439" v-slot="timeObj">
<div class="count-down">
<div class="icon"></div>
{{ timeObj.d }}天{{ timeObj.hh }}小时{{ timeObj.mm }}分钟{{
timeObj.ss
}}秒
</div>
</CountDown>
</div>
</template>
<script>
export default {
name: "App",
};
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).