-
-
Save uno-de-piera/d8b555d799f781f60fb25620707408c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div class="card text-white bg-info mb-3" v-if="seconds"> | |
<div class="card-body"> | |
<h2>{{ countdown }}</h2> | |
</div> | |
</div> | |
</div> | |
</template> | |
<script> | |
import * as moment from 'moment'; | |
export default { | |
name: 'CountDown', | |
props: { | |
seconds: { | |
type: Number, | |
required: true | |
} | |
}, | |
data () { | |
return { | |
countdown: null, | |
expires_in: null, | |
interval: null, | |
} | |
}, | |
mounted () { | |
this.countdown = moment.utc(this.seconds).format('HH:mm:ss'); | |
this.expires_in = this.seconds; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment