fixes formatting and lints

This commit is contained in:
2024-12-27 11:05:47 -05:00
parent 147d1abaf8
commit 12f27bad69
11 changed files with 281 additions and 210 deletions

View File

@@ -1,6 +1,5 @@
<script setup lang="ts">
import { computed, ref, useTemplateRef, watch, watchPostEffect } from 'vue';
import { useNow } from '@/composables/ticker';
import { computed, ref, useTemplateRef, watch } from 'vue';
const props = defineProps<{
x: number;
@@ -19,12 +18,15 @@ const value_text = computed(() => {
const label_width = ref(0);
watch([value_text, labelRef], ([_, label]) => {
label_width.value = label?.getBBox().width || 0;
}, {
flush: 'post',
});
watch(
[value_text, labelRef],
([, label]) => {
label_width.value = label?.getBBox().width || 0;
},
{
flush: 'post',
},
);
</script>
<template>
@@ -34,11 +36,7 @@ watch([value_text, labelRef], ([_, label]) => {
:width="label_width + background_offset * 2"
:height="16 + background_offset * 2"
></rect>
<text
ref="label-ref"
:x="x"
:y="y"
>
<text ref="label-ref" :x="x" :y="y">
{{ value_text }}
</text>
</template>
@@ -59,4 +57,4 @@ text {
fill: var(--indexed-color);
dominant-baseline: middle;
}
</style>
</style>