perf(client): use shallowRef as possible

This commit is contained in:
syuilo
2022-08-06 19:20:53 +09:00
parent cb35ace047
commit c4830dcf3a
2 changed files with 6 additions and 5 deletions

View File

@ -20,7 +20,7 @@ const props = withDefaults(defineProps<{
const _time = typeof props.time === 'string' ? new Date(props.time) : props.time;
const absolute = _time.toLocaleString();
let now = $ref(new Date());
let now = $shallowRef(new Date());
const relative = $computed(() => {
const ago = (now.getTime() - _time.getTime()) / 1000/*ms*/;
return (