chore: install prettier

This commit is contained in:
Viet An
2026-05-04 15:22:27 +07:00
parent 93d29ca7d8
commit bd58e2b847
267 changed files with 22950 additions and 13581 deletions

View File

@@ -1,38 +1,45 @@
<template>
<div id="countdown">
<div id="countdown-number"></div>
<svg><circle r="18" cx="20" cy="20" color="red"></circle></svg>
</div>
<div id="countdown">
<div id="countdown-number"></div>
<svg>
<circle
r="18"
cx="20"
cy="20"
color="red"
></circle>
</svg>
</div>
</template>
<script>
export default {
props: ['duration'],
props: ["duration"],
data() {
return {
timer: undefined,
countdown: this.duration || 10
}
countdown: this.duration || 10,
};
},
mounted() {
var countdownNumberEl = document.getElementById('countdown-number')
var countdownNumberEl = document.getElementById("countdown-number");
countdownNumberEl.textContent = this.countdown;
this.timer = setInterval(()=>this.startCount(), 1000)
this.timer = setInterval(() => this.startCount(), 1000);
},
beforeDestroy() {
clearInterval(this.timer)
clearInterval(this.timer);
},
methods: {
startCount() {
this.countdown -= 1
var countdownNumberEl = document.getElementById('countdown-number')
this.countdown -= 1;
var countdownNumberEl = document.getElementById("countdown-number");
countdownNumberEl.textContent = this.countdown;
if(this.countdown===0) {
clearInterval(this.timer)
this.$emit('close')
if (this.countdown === 0) {
clearInterval(this.timer);
this.$emit("close");
}
}
}
}
},
},
};
</script>
<style scoped>
#countdown {
@@ -72,4 +79,4 @@ export default {
stroke-dashoffset: 113px;
}
}
</style>
</style>