Skip to content

Commit b885c21

Browse files
authored
Merge pull request #211 from niceplugin/tutorial/step-2
번역: tutorial/step-2
2 parents b85eb98 + bb40475 commit b885c21

File tree

7 files changed

+45
-30
lines changed

7 files changed

+45
-30
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { ref } from 'vue'
22

33
export default {
44
setup() {
5-
// component logic
5+
// 컴포넌트 로직
66

77
return {
8-
// exposed to template
8+
// 템플릿에 노출
99
}
1010
}
1111
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default {
2-
// component options
2+
// 컴포넌트 옵션
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<h1>Hello World!</h1>
1+
<h1>안녕 Vue!</h1>

ko-KR/src/tutorial/src/step-2/_hint/App/composition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { reactive, ref } from 'vue'
33
export default {
44
setup() {
55
const counter = reactive({ count: 0 })
6-
const message = ref('Hello World!')
6+
const message = ref('안녕 Vue!')
77

88
return {
99
counter,

ko-KR/src/tutorial/src/step-2/_hint/App/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
data() {
33
return {
4-
message: 'Hello World!',
4+
message: '안녕 Vue!',
55
counter: {
66
count: 0
77
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<h1>{{ message }}</h1>
2-
<p>Count is: {{ counter.count }}</p>
2+
<p>숫자 세기: {{ counter.count }}</p>
Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
# Declarative Rendering
1+
# 선언적 렌더링
22

33
<div class="sfc">
44

5-
What you see in the editor is a Vue Single File Component (SFC). An SFC is a reusable self-contained block of code that encapsulates HTML, CSS and JavaScript that belong together, written inside a `.vue` file.
5+
편집기에 보이는 것은 Vue SFC(Single File Component)입니다.
6+
SFC는 HTML, CSS, JavaScript를 캡슐화한 코드 블록으로 재사용 가능한 `.vue` 파일입니다.
67

78
</div>
89

9-
The core feature of Vue is **declarative rendering**: using a template syntax that extends HTML, we can describe how the HTML should look like based on JavaScript state. When the state changes, the HTML updates automatically.
10+
Vue의 핵심 기능은 **선언적 렌더링**입니다.
11+
HTML을 확장하는 템플릿 문법을 사용하여 JavaScript 상태를 기반으로 HTML이 어떻게 보이는지 설명할 수 있습니다.
12+
상태가 변경되면 HTML이 자동으로 업데이트됩니다.
1013

1114
<div class="composition-api">
1215

13-
State that can trigger updates when changed are considered **reactive**. We can declare reactive state using Vue's `reactive()` API. Objects created from `reactive()` are JavaScript [Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) that work just like normal objects:
16+
변경 시, 업데이트를 트리거할 수 있는 상태는 **반응형**으로 간주됩니다.
17+
Vue의 `reactive()` API를 사용하여 반응형 상태를 선언할 수 있습니다.
18+
`reactive()`로 생성된 객체는 일반 객체처럼 작동하는 JavaScript [프록시](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)입니다:
1419

1520
```js
1621
import { reactive } from 'vue'
@@ -23,66 +28,74 @@ console.log(counter.count) // 0
2328
counter.count++
2429
```
2530

26-
`reactive()` only works on objects (including arrays and built-in types like `Map` and `Set`). `ref()`, on the other hand, can take any value type and create an object that exposes the inner value under a `.value` property:
31+
`reactive()`는 객체(배열, `Map`, `Set`과 같은 빌트인 타입 포함)에서만 작동합니다.
32+
반면에 `ref()`는 모든 타입의 값을 사용할 수 있으며,
33+
`.value` 속성으로 내부 값을 노출하는 객체를 생성합니다.
2734

2835
```js
2936
import { ref } from 'vue'
3037

31-
const message = ref('Hello World!')
38+
const message = ref('안녕 Vue!')
3239

33-
console.log(message.value) // "Hello World!"
34-
message.value = 'Changed'
40+
console.log(message.value) // "안녕 Vue!"
41+
message.value = '메세지 변경됨'
3542
```
3643

37-
Details on `reactive()` and `ref()` are discussed in <a target="_blank" href="/guide/essentials/reactivity-fundamentals.html">Guide - Reactivity Fundamentals</a>.
44+
`reactive()` `ref()`에 대한 자세한 내용은 <a target="_blank" href="/guide/essentials/reactivity-fundamentals.html">가이드 - 반응형 기초</a>에서 설명합니다.
3845

3946
<div class="sfc">
4047

41-
Reactive state declared in the component's `<script setup>` block can be used directly in the template. This is how we can render dynamic text based on the value of the `counter` object and `message` ref, using mustaches syntax:
48+
컴포넌트의 `<script setup>` 블록에 선언된 반응형 상태는 템플릿에서 직접 사용할 수 있습니다.
49+
이것은 이중 중괄호 문법을 사용하여 `counter` 객체와 `message` ref의 값을 동적으로 텍스트로 렌더링하는 방법입니다.
4250

4351
</div>
4452

4553
<div class="html">
4654

47-
The object being passed to `createApp()` is a Vue component. A component's state should be declared inside its `setup()` function, and returned using an object:
55+
`createApp()`에 전달되는 객체는 Vue 컴포넌트입니다.
56+
컴포넌트의 상태는 `setup()` 함수 내에서 선언되어야 하며, 객체를 사용하여 반환되어야 합니다:
4857

4958
```js{2,5}
5059
setup() {
5160
const counter = reactive({ count: 0 })
52-
const message = ref('Hello World!')
61+
const message = ref('안녕 Vue!')
5362
return {
5463
counter,
5564
message
5665
}
5766
}
5867
```
5968

60-
Properties in the returned object will be made available in the template. This is how we can render dynamic text based on the value of `message`, using mustaches syntax:
69+
반환된 객체의 속성은 템플릿에서 사용할 수 있습니다.
70+
이것은 이중 중괄호 문법을 사용하여 `message` 값을 동적 텍스트로 렌더링하는 방법입니다:
6171

6272
</div>
6373

6474
```vue-html
6575
<h1>{{ message }}</h1>
66-
<p>count is: {{ counter.count }}</p>
76+
<p>숫자 세기: {{ counter.count }}</p>
6777
```
6878

69-
Notice how we did not need to use `.value` when accessing the `message` ref in templates: it is automatically unwrapped for more succinct usage.
79+
템플릿에서 `message` ref에 접근할 때, `.value`를 사용할 필요가 없습니다!
80+
보다 간결한 사용을 위해 자동으로 언래핑됩니다.
7081

7182
</div>
7283

7384
<div class="options-api">
7485

75-
State that can trigger updates when changed are considered **reactive**. In Vue, reactive state is held in components. In the example code, the object being passed to `createApp()` is a component.
86+
변경 시, 업데이트를 트리거할 수 있는 상태는 **반응형**으로 간주됩니다.
87+
Vue에서 반응형 상태는 컴포넌트에 유지됩니다.
88+
예제 코드에서 `createApp()`에 전달되는 객체는 컴포넌트입니다.
7689

77-
We can declare reactive state using the `data` component option, which should be a function that returns an object:
90+
컴포넌트에서 객체를 반환해야하는 함수 `data` 옵션을 사용하여 반응형 상태를 선언할 수 있습니다:
7891

7992
<div class="sfc">
8093

8194
```js{3-5}
8295
export default {
8396
data() {
8497
return {
85-
message: 'Hello World!'
98+
message: '안녕 Vue!'
8699
}
87100
}
88101
}
@@ -95,36 +108,38 @@ export default {
95108
createApp({
96109
data() {
97110
return {
98-
message: 'Hello World!'
111+
message: '안녕 Vue!'
99112
}
100113
}
101114
})
102115
```
103116

104117
</div>
105118

106-
The `message` property will be made available in the template. This is how we can render dynamic text based on the value of `message`, using mustaches syntax:
119+
템플릿에서 `message` 속성을 사용할 수 있습니다.
120+
이것은 이중 중괄호 문법을 사용하여 `message` 값을 동적으로 텍스트로 렌더링하는 방법입니다:
107121

108122
```vue-html
109123
<h1>{{ message }}</h1>
110124
```
111125

112126
</div>
113127

114-
The content inside the mustaches is not limited to just identifiers or paths - we can use any valid JavaScript expression:
128+
이중 중괄호 내부의 내용은 식별자나 경로에만 국한되지 않습니다.
129+
유효한 JavaScript 표현식을 사용할 수도 있습니다:
115130

116131
```vue-html
117132
<h1>{{ message.split('').reverse().join('') }}</h1>
118133
```
119134

120135
<div class="composition-api">
121136

122-
Now, try to create some reactive state yourself, and use it to render dynamic text content for the `<h1>` in the template.
137+
이제 반응형 상태를 직접 만들고 이를 사용하여 템플릿의 `<h1>`에 동적 텍스트 콘텐츠를 렌더링해봅시다.
123138

124139
</div>
125140

126141
<div class="options-api">
127142

128-
Now, try to create a data property yourself, and use it as the text content for the `<h1>` in the template.
143+
이제 직접 `data` 속성을 만들고 템플릿의 `<h1>`에 텍스트 콘텐츠로 사용해봅시다.
129144

130145
</div>

0 commit comments

Comments
 (0)