<template> <u-count-down :time="30 * 60 * 60 * 1000" format="DD:HH:mm:ss" autoStart millisecond @change="onChange" > <view class="time"> <text class="time__item">{{ timeData.days }} 天</text> <text class="time__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}} 时</text> <text class="time__item">{{ timeData.minutes }} 分</text> <text class="time__item">{{ timeData.seconds }} 秒</text> </view> </u-count-down> </template>
<script> export default { data() { return { timeData: {}, } }, methods: { onChange(e) { this.timeData = e } } } </script>
<style lang="scss"> .time { @include flex; align-items: center; &__item { color: #fff; font-size: 12px; text-align: center; } } </style>