Skip to content

Commit 8cfa498

Browse files
i18n(ko-KR): update images.mdx (#12426)
Co-authored-by: Yan <[email protected]>
1 parent 2b841f2 commit 8cfa498

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/content/docs/ko/guides/images.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,33 @@ import Logo from '../assets/logo.svg';
435435
<Logo width={64} height={64} fill="currentColor" />
436436
```
437437

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+
438465
### 사용자 정의 이미지 컴포넌트 만들기
439466

440467
`<Image />` 또는 `<Picture/>` 컴포넌트를 다른 Astro 컴포넌트로 래핑하여 재사용 가능한 사용자 정의 이미지 컴포넌트를 만들 수 있습니다. 이렇게 하면 기본 속성과 스타일을 한 번만 설정할 수 있습니다.

0 commit comments

Comments
 (0)