chore: eslint

This commit is contained in:
Yuki.N 2025-04-07 23:08:20 +08:00
parent 40247efa7d
commit 55d0a1e998
2 changed files with 7 additions and 5 deletions

View file

@ -1,7 +1,9 @@
<script lang="ts">
import type { RitualBeastType } from './+page.ts';
let { data } = $props();
let rb = $derived(data.rb.map((rb: any) => ({ ...rb })));
let rb = $derived(data.rb.map((rb: RitualBeastType) => ({ ...rb })));
let announcement = $state('');
function handleToggle(index: number, checked: boolean) {
@ -17,7 +19,7 @@
<div class="container" role="region" aria-label="灵兽特招记录">
<h1 id="ritual-beast-title">灵兽特招记录</h1>
<div class="ritual-beast-list" role="list" aria-labelledby="ritual-beast-title">
{#each rb as _rb, index}
{#each rb as _rb, index (_rb.id)}
<div class="ritual-beast-item" role="listitem">
<span id={`rb-name-${index}`}>{_rb.name}</span>
<label class="switch">

View file

@ -1,13 +1,13 @@
import type { PageLoad } from './$types';
interface RitualBeastType {
export interface RitualBeastType {
id: number;
name: string;
special_summon: boolean;
}
export const load: PageLoad = () => {
const data: RitualBeastType[] = new Array(
const data: RitualBeastType[] = [
{ id: 1, name: '企鹅(兽)', special_summon: false },
{ id: 2, name: '川豚(兽)', special_summon: false },
{ id: 3, name: '新蕾拉(人兽)', special_summon: false },
@ -18,7 +18,7 @@ export const load: PageLoad = () => {
{ id: 8, name: '长老(人)', special_summon: false },
{ id: 9, name: '雯(人)', special_summon: false },
{ id: 10, name: '雷鹰(兽)', special_summon: false }
);
];
return {
rb: data as RitualBeastType[]
};