change format settings

This commit is contained in:
2024-12-04 20:00:18 -08:00
parent 07b585f956
commit 4c2b0f454b
14 changed files with 691 additions and 665 deletions

View File

@@ -1,19 +1,19 @@
import { onMounted, onUnmounted, ref, shallowRef } from 'vue'
import { onMounted, onUnmounted, ref, shallowRef } from 'vue';
export function useNow(update_ms: number) {
const handle = shallowRef<number | undefined>(undefined)
const now = ref(Date.now())
const handle = shallowRef<number | undefined>(undefined);
const now = ref(Date.now());
onMounted(() => {
handle.value = setInterval(() => {
now.value = Date.now()
}, update_ms)
})
onUnmounted(() => {
if (handle.value) {
clearInterval(handle.value)
}
})
onMounted(() => {
handle.value = setInterval(() => {
now.value = Date.now();
}, update_ms);
});
onUnmounted(() => {
if (handle.value) {
clearInterval(handle.value);
}
});
return now
return now;
}