Skip to content

Commit cdb7477

Browse files
committed
번역: tutorial/step-13
1 parent 28c6e86 commit cdb7477

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

ko-KR/src/tutorial/src/step-13/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 childMsg = ref('No child msg yet')
9+
const childMsg = ref('자식 컴포넌트로부터 아직 메시지를 받지 못했어요!')
1010

1111
return {
1212
childMsg

ko-KR/src/tutorial/src/step-13/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-
childMsg: 'No child msg yet'
9+
childMsg: '자식 컴포넌트로부터 아직 메시지를 받지 못했어요!'
1010
}
1111
}
1212
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
emits: ['response'],
33
setup(props, { emit }) {
4-
emit('response', 'hello from child')
4+
emit('response', '자식 컴포넌트로부터 🌷를 받았어요!')
55
return {}
66
}
77
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
emits: ['response'],
33
created() {
4-
this.$emit('response', 'hello from child')
4+
this.$emit('response', '자식 컴포넌트로부터 🌷를 받았어요!')
55
}
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<h2>Child component</h2>
1+
<h2>자식 컴포넌트</h2>

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Emits
22

3-
In addition to receiving props, a child component can also emit events to the parent:
3+
자식 컴포넌트는 부모로부터 props를 받는 것 뿐만 아니라 이벤트를 emit(발송)할 수도 있습니다:
44

55
<div class="composition-api">
66
<div class="sfc">
77

88
```vue
99
<script setup>
10-
// declare emitted events
10+
// emit할 이벤트 선언
1111
const emit = defineEmits(['response'])
1212
13-
// emit with argument
14-
emit('response', 'hello from child')
13+
// 인자와 함께 emit
14+
emit('response', '자식 컴포넌트로부터 🌷를 받았어요!')
1515
</script>
1616
```
1717

@@ -21,11 +21,11 @@ emit('response', 'hello from child')
2121

2222
```js
2323
export default {
24-
// declare emitted events
24+
// emit할 이벤트 선언
2525
emits: ['response'],
2626
setup(props, { emit }) {
27-
// emit with argument
28-
emit('response', 'hello from child')
27+
// 인자와 함께 emit
28+
emit('response', '자식 컴포넌트로부터 🌷를 받았어요!')
2929
}
3030
}
3131
```
@@ -38,20 +38,22 @@ export default {
3838

3939
```js
4040
export default {
41-
// declare emitted events
41+
// emit할 이벤트 선언
4242
emits: ['response'],
4343
created() {
44-
// emit with argument
45-
this.$emit('response', 'hello from child')
44+
// 인자와 함께 emit
45+
this.$emit('response', '자식 컴포넌트로부터 🌷를 받았어요!')
4646
}
4747
}
4848
```
4949

5050
</div>
5151

52-
The first argument to <span class="options-api">`this.$emit()`</span><span class="composition-api">`emit()`</span> is the event name. Any additional arguments are passed on to the event listener.
52+
<span class="options-api">`this.$emit()`</span><span class="composition-api">`emit()`</span>의 첫 번째 인자는 이벤트 이름입니다.
53+
이후 추가되는 모든 인자는 이벤트 리스너에 전달됩니다.
5354

54-
The parent can listen to child-emitted events using `v-on` - here the handler receives the extra argument from the child emit call and assigns it to local state:
55+
부모는 `v-on`을 사용하여 자식이 발송한 이벤트를 수신할 수 있습니다.
56+
아래 예시 코드는 자식이 이벤트를 발송할 때 추가한 인자를 핸들러에서 받아 로컬 상태에 할당한 것입니다:
5557

5658
<div class="sfc">
5759

@@ -68,4 +70,6 @@ The parent can listen to child-emitted events using `v-on` - here the handler re
6870

6971
</div>
7072

71-
Now try it yourself in the editor.
73+
자식 컴포넌트가 `response` 이벤트에 메시지 인자를 추가하여 발송하고 있습니다.
74+
부모 컴포넌트에서 해당 이벤트를 수신하고,
75+
메세지 인자를 `childMsg`에 적용해봅시다!

0 commit comments

Comments
 (0)