File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
src/content/docs/ko/guides Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -435,6 +435,33 @@ import Logo from '../assets/logo.svg';
435
435
<Logo width={64} height={64} fill="currentColor" />
436
436
```
437
437
438
+ #### ` SvgComponent ` 타입
439
+
440
+ <Since v = " 5.14.0" />
441
+
442
+ ` SvgComponent ` 타입을 사용하여 ` .svg ` 자산에 대한 타입 안전성을 강제로 적용할 수도 있습니다.
443
+
444
+ ``` astro title="src/components/Logo.astro"
445
+ ---
446
+ import type { SvgComponent } from "astro/types";
447
+ import HomeIcon from './Home.svg'
448
+
449
+ interface Link {
450
+ url: string
451
+ text: string
452
+ icon: SvgComponent
453
+ }
454
+
455
+ const links: Link[] = [
456
+ {
457
+ url: '/',
458
+ text: 'Home',
459
+ icon: HomeIcon
460
+ }
461
+ ]
462
+ ---
463
+ ```
464
+
438
465
### 사용자 정의 이미지 컴포넌트 만들기
439
466
440
467
` <Image /> ` 또는 ` <Picture/> ` 컴포넌트를 다른 Astro 컴포넌트로 래핑하여 재사용 가능한 사용자 정의 이미지 컴포넌트를 만들 수 있습니다. 이렇게 하면 기본 속성과 스타일을 한 번만 설정할 수 있습니다.
You can’t perform that action at this time.
0 commit comments