Replace with vue/no-setup-props-reactivity-loss rule (#14062)

This commit is contained in:
woxtu
2024-06-22 12:40:00 +09:00
committed by GitHub
parent a9012d3d0c
commit 4d2eddec2e
9 changed files with 10 additions and 10 deletions

View File

@@ -41,12 +41,12 @@ function getDateSafe(n: Date | string | number) {
}
}
// eslint-disable-next-line vue/no-setup-props-destructure
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
const _time = props.time == null ? NaN : getDateSafe(props.time).getTime();
const invalid = Number.isNaN(_time);
const absolute = !invalid ? dateTimeFormat.format(_time) : i18n.ts._ago.invalid;
// eslint-disable-next-line vue/no-setup-props-destructure
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
const now = ref(props.origin?.getTime() ?? Date.now());
const ago = computed(() => (now.value - _time) / 1000/*ms*/);