chore: use derive for reactivity
This commit is contained in:
parent
090b541056
commit
95e42a9df2
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
let { rank, ...rest }: { rank: number } & HTMLAttributes<HTMLDivElement> = $props();
|
let { rank, ...rest }: { rank: number } & HTMLAttributes<HTMLDivElement> = $props();
|
||||||
|
|
||||||
const [xOffset, yOffset] = imageOffset(rank);
|
const [xOffset, yOffset] = $derived(imageOffset(rank));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div {...rest}>
|
<div {...rest}>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
let { version, ...rest }: { version: string } & HTMLAttributes<HTMLImageElement> = $props();
|
let { version, ...rest }: { version: string } & HTMLAttributes<HTMLImageElement> = $props();
|
||||||
|
|
||||||
const { minor } = fromVersionString(version);
|
const { minor } = $derived(fromVersionString(version));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<img src="/versions/{gameVersions[minor.toString()]}" alt={version} {...rest} />
|
<img src="/versions/{gameVersions[minor.toString()]}" alt={version} {...rest} />
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
let { rating }: { rating: number } = $props();
|
let { rating }: { rating: number } = $props();
|
||||||
|
|
||||||
const characters = rating.toString().padStart(4, '0');
|
const characters = $derived(rating.toString().padStart(4, '0'));
|
||||||
const type = ratingType(rating);
|
const type = $derived(ratingType(rating));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
...rest
|
...rest
|
||||||
}: { character: number | '.'; type: number } & HTMLAttributes<HTMLDivElement> = $props();
|
}: { character: number | '.'; type: number } & HTMLAttributes<HTMLDivElement> = $props();
|
||||||
|
|
||||||
const [xOffset, yOffset] = imageOffset(character, type);
|
const [xOffset, yOffset] = $derived(imageOffset(character, type));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div {...rest}>
|
<div {...rest}>
|
||||||
|
Loading…
Reference in New Issue
Block a user