fixes formatting and lints
This commit is contained in:
@@ -140,8 +140,7 @@ const lines = computed(() => {
|
||||
:timestamp="tick"
|
||||
:utc="props.utc"
|
||||
:show_millis="duration < 1000"
|
||||
>
|
||||
</TimeText>
|
||||
></TimeText>
|
||||
</template>
|
||||
</g>
|
||||
<slot></slot>
|
||||
|
||||
@@ -5,8 +5,8 @@ const props = defineProps<{
|
||||
x: number;
|
||||
y: number;
|
||||
timestamp: number;
|
||||
utc?: boolean
|
||||
show_millis?: boolean
|
||||
utc?: boolean;
|
||||
show_millis?: boolean;
|
||||
}>();
|
||||
|
||||
// This function is slow
|
||||
@@ -61,18 +61,12 @@ function getDateString(date: Date) {
|
||||
const timetext = computed(() => {
|
||||
return getDateString(new Date(props.timestamp));
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<text
|
||||
:x="props.x"
|
||||
:y="props.y"
|
||||
>
|
||||
<text :x="props.x" :y="props.y">
|
||||
{{ timetext }}
|
||||
</text>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user