Skip to content

Commit 684211c

Browse files
01-svelte/03-props/03-spread-props (#86)
1 parent 818e55f commit 684211c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: Spread props
2+
title: 프롭 뿌리기
33
---
44

5-
In this exercise, we've forgotten to specify the `version` prop expected by `PackageInfo.svelte`, meaning it shows 'version undefined'.
5+
이번 연습은 `PackageInfo.svelte`에서 기대하는 `version` 프롭을 지정하는 것을 잊은 상황입니다. 그래서 'version undefined'가 표시됩니다.
66

7-
We _could_ fix it by adding the `version` prop...
7+
`version` 프롭을 추가하여 이를 _해결할_ __ __ 있습니다.
88

99
```svelte
1010
/// file: App.svelte
@@ -16,11 +16,11 @@ We _could_ fix it by adding the `version` prop...
1616
/>
1717
```
1818

19-
...but since the properties of `pkg` correspond to the component's expected props, we can 'spread' them onto the component instead:
19+
하지만 `pkg`의 속성이 컴포넌트가 기대하는 프롭과 일치하므로, `뿌리기(spread)`를 사용할 수 있습니다.
2020

2121
```svelte
2222
/// file: App.svelte
2323
<PackageInfo +++{...pkg}+++ />
2424
```
2525

26-
> Conversely, if you need to reference all the props that were passed into a component, including ones that weren't declared with `export`, you can do so by accessing `$$props` directly. It's not generally recommended, as it's difficult for Svelte to optimise, but it's useful in rare cases.
26+
> 반대로, `export`로 선언되지 않은 것들을 포함해 컴포넌트에 전달된 모든 프롭을 참조해야 하는 경우 `$$props`와 같이 직접 접근하여 사용할 수 있습니다. 최적화가 어렵기 때문에 권장되지 않지만, 드물게 사용됩니다.

content/tutorial/01-svelte/03-props/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"title": "Props",
2+
"title": "프롭",
33
"scope": {
44
"prefix": "/src/lib/",
55
"name": "src"

0 commit comments

Comments
 (0)