You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ko-KR/src/tutorial/src/step-12/description.md
+16-9Lines changed: 16 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# Props
2
2
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를 선언해야 합니다:
4
5
5
6
<divclass="composition-api">
6
7
<divclass="sfc">
@@ -14,25 +15,29 @@ const props = defineProps({
14
15
</script>
15
16
```
16
17
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에서 접근할 수 있습니다.
18
21
19
22
</div>
20
23
21
24
<divclass="html">
22
25
23
26
```js
24
-
//in child component
27
+
//자식 컴포넌트에서
25
28
exportdefault {
26
29
props: {
27
30
msg:String
28
31
},
29
32
setup(props) {
30
-
//access props.msg
33
+
// props.msg에 접근 가능
31
34
}
32
35
}
33
36
```
34
37
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()`에 첫 번째 인자로 전달됩니다.
36
41
37
42
</div>
38
43
@@ -41,19 +46,21 @@ Once declared, the `msg` prop is exposed on `this` and can be used in the child
41
46
<divclass="options-api">
42
47
43
48
```js
44
-
//in child component
49
+
//자식 컴포넌트에서
45
50
exportdefault {
46
51
props: {
47
52
msg:String
48
53
}
49
54
}
50
55
```
51
56
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
+
자식 컴포넌트의 템플릿에서 사용할 수 있습니다.
53
59
54
60
</div>
55
61
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` 문법을 사용할 수도 있습니다:
57
64
58
65
<divclass="sfc">
59
66
@@ -70,4 +77,4 @@ The parent can pass the prop to the child just like attributes. To pass a dynami
0 commit comments