Restrukturyzacja kodu

This commit is contained in:
2020-08-22 15:18:59 +02:00
parent 3cc9381d83
commit c6e3e3f779
15 changed files with 371 additions and 788 deletions
+40
View File
@@ -0,0 +1,40 @@
<template>
<div class="clock">{{ formattedDate }}</div>
</template>
<script lang="ts">
import Vue from "vue";
export default Vue.extend({
name: "clock",
data: () => ({
timestamp: Date.now(),
}),
computed: {
formattedDate() {
return new Date(this.timestamp).toLocaleString("pl-PL", {
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
});
},
},
mounted() {
setInterval(() => (this.timestamp = Date.now()), 1000);
},
});
</script>
<style lang="scss" scoped>
@import "../../styles/responsive.scss";
.clock {
display: flex;
justify-content: center;
align-items: center;
@include smallScreen() {
font-size: 0.65rem;
}
}
</style>