Skip to content

Commit 022a33d

Browse files
committed
번역: tutorial/step-12
1 parent 28c6e86 commit 022a33d

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

ko-KR/src/tutorial/src/step-12/App/composition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
ChildComp
77
},
88
setup() {
9-
const greeting = ref('Hello from parent')
9+
const greeting = ref('부모 컴포넌트로부터 💌을 전달받았어요!')
1010

1111
return {
1212
greeting

ko-KR/src/tutorial/src/step-12/App/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
},
77
data() {
88
return {
9-
greeting: 'Hello from parent'
9+
greeting: '부모 컴포넌트로부터 💌을 전달받았어요!'
1010
}
1111
}
1212
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<h2>{{ msg || 'No props passed yet' }}</h2>
1+
<h2>{{ msg || 'prop이 아직 전달되지 않았습니다!' }}</h2>

ko-KR/src/tutorial/src/step-12/description.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Props
22

3-
A child component can accept input from the parent via **props**. First, it needs to declare the props it accepts:
3+
자식 컴포넌트는 **props**를 통해 부모로부터 데이터를 받을 수 있습니다.
4+
우선, 허용할 props를 선언해야 합니다:
45

56
<div class="composition-api">
67
<div class="sfc">
@@ -14,25 +15,29 @@ const props = defineProps({
1415
</script>
1516
```
1617

17-
Note `defineProps()` is a compile-time macro and doesn't need to be imported. Once declared, the `msg` prop can be used in the child component's template. It can also be accessed in JavaScript via the returned object of `defineProps()`.
18+
참고로 `defineProps()`는 컴파일 타임 매크로이므로 `import` 할 필요가 없습니다.
19+
일단 선언되면 `msg` prop은 자식 컴포넌트 템플릿에서 사용할 수 있습니다.
20+
또한 `defineProps()`에서 반환된 객체는 JavaScript에서 접근할 수 있습니다.
1821

1922
</div>
2023

2124
<div class="html">
2225

2326
```js
24-
// in child component
27+
// 자식 컴포넌트에서
2528
export default {
2629
props: {
2730
msg: String
2831
},
2932
setup(props) {
30-
// access props.msg
33+
// props.msg에 접근 가능
3134
}
3235
}
3336
```
3437

35-
Once declared, the `msg` prop is exposed on `this` and can be used in the child component's template. The received props are passed to `setup()` as the first argument.
38+
일단 선언되면 `msg` prop이 `this`에 노출되고,
39+
자식 컴포넌트의 템플릿에서 사용할 수 있습니다.
40+
전달 받은 props는 `setup()`에 첫 번째 인자로 전달됩니다.
3641

3742
</div>
3843

@@ -41,19 +46,21 @@ Once declared, the `msg` prop is exposed on `this` and can be used in the child
4146
<div class="options-api">
4247

4348
```js
44-
// in child component
49+
// 자식 컴포넌트에서
4550
export default {
4651
props: {
4752
msg: String
4853
}
4954
}
5055
```
5156

52-
Once declared, the `msg` prop is exposed on `this` and can be used in the child component's template.
57+
일단 선언되면 `msg` prop이 `this`에 노출되고,
58+
자식 컴포넌트의 템플릿에서 사용할 수 있습니다.
5359

5460
</div>
5561

56-
The parent can pass the prop to the child just like attributes. To pass a dynamic value, we can also use the `v-bind` syntax:
62+
부모는 속성을 사용하는 것처럼 자식에게 prop을 전달할 수 있습니다.
63+
동적 값을 전달하기 위해 `v-bind` 문법을 사용할 수도 있습니다:
5764

5865
<div class="sfc">
5966

@@ -70,4 +77,4 @@ The parent can pass the prop to the child just like attributes. To pass a dynami
7077

7178
</div>
7279

73-
Now try it yourself in the editor.
80+
이제 `greeting` 속성을 자식 컴포넌트에 `msg`라는 prop으로 전달해봅시다!

0 commit comments

Comments
 (0)