chore: use derive for reactivity

This commit is contained in:
metamethods 2025-01-03 01:09:19 -08:00
parent 090b541056
commit 95e42a9df2
4 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
let { rank, ...rest }: { rank: number } & HTMLAttributes<HTMLDivElement> = $props();
const [xOffset, yOffset] = imageOffset(rank);
const [xOffset, yOffset] = $derived(imageOffset(rank));
</script>
<div {...rest}>

View File

@ -5,7 +5,7 @@
let { version, ...rest }: { version: string } & HTMLAttributes<HTMLImageElement> = $props();
const { minor } = fromVersionString(version);
const { minor } = $derived(fromVersionString(version));
</script>
<img src="/versions/{gameVersions[minor.toString()]}" alt={version} {...rest} />

View File

@ -4,8 +4,8 @@
let { rating }: { rating: number } = $props();
const characters = rating.toString().padStart(4, '0');
const type = ratingType(rating);
const characters = $derived(rating.toString().padStart(4, '0'));
const type = $derived(ratingType(rating));
</script>
<div class="flex items-center">

View File

@ -8,7 +8,7 @@
...rest
}: { character: number | '.'; type: number } & HTMLAttributes<HTMLDivElement> = $props();
const [xOffset, yOffset] = imageOffset(character, type);
const [xOffset, yOffset] = $derived(imageOffset(character, type));
</script>
<div {...rest}>