Добавила подсветку текушего времени

This commit is contained in:
Daria Golova
2022-10-17 17:04:59 +03:00
parent bc7e82b88e
commit fbbe2778d7
4 changed files with 59 additions and 49 deletions

View File

@@ -1,6 +1,6 @@
<template lang="pug">
.calendar-clock-column.flex.flex-col.items-end.gap-y-43.pt-9.pb-12.px-3
span.font-medium.text-base(v-for="hour in hoursArray") {{ hour }}
span.font-medium.text-base(v-for="hour in hoursArray" :key="hour" :class="currentHourStyle(hour)") {{ hour }}
</template>
<script>
@@ -8,11 +8,33 @@ export default {
name: "CalendarClockColumn",
props: {
hoursArray: Array,
currentTime: String,
},
computed: {
currentHour() {
return parseInt(this.currentTime.slice(0, -6), 10);
},
},
methods: {
currentHourStyle(elem) {
if (parseInt(elem.slice(0, 3), 10) === this.currentHour) {
return {
"current-time": true,
"font-bold": true,
};
}
return {
"current-time": false,
};
},
},
};
</script>
<style lang="sass" scoped>
.current-time
color: var(--time-indicator-color)
.calendar-clock-column
width: 80px
height: 100%