Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/content/docs/ko/guides/images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,33 @@ import Logo from '../assets/logo.svg';
<Logo width={64} height={64} fill="currentColor" />
```

#### `SvgComponent` 타입

<Since v="5.14.0" />

`SvgComponent` 타입을 사용하여 `.svg` 자산에 대한 타입 안전성을 강제로 적용할 수도 있습니다.

```astro title="src/components/Logo.astro"
---
import type { SvgComponent } from "astro/types";
import HomeIcon from './Home.svg'

interface Link {
url: string
text: string
icon: SvgComponent
}

const links: Link[] = [
{
url: '/',
text: 'Home',
icon: HomeIcon
}
]
---
```

### 사용자 정의 이미지 컴포넌트 만들기

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