You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vous pouvez également appliquer la sûreté du typage pour vos ressources `.svg` à l'aide du type `SvgComponent` :
441
+
442
+
```astro title="src/components/Logo.astro"
443
+
---
444
+
import type { SvgComponent } from "astro/types";
445
+
import HomeIcon from './Home.svg'
446
+
447
+
interface Link {
448
+
url: string
449
+
text: string
450
+
icon: SvgComponent
451
+
}
452
+
453
+
const links: Link[] = [
454
+
{
455
+
url: '/',
456
+
text: 'Accueil',
457
+
icon: HomeIcon
458
+
}
459
+
]
460
+
---
461
+
```
462
+
436
463
### Création de composants d'image personnalisés
437
464
438
465
Vous pouvez créer un composant d'image personnalisé et réutilisable en enveloppant le composant `<Image />` ou `<Picture/>` dans un autre composant Astro. Cela vous permet de définir les attributs et les styles par défaut une seule fois.
0 commit comments