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
Due to its frequent use, `v-on` also has a shorthand syntax:
9
+
자주 사용되기 때문에 `v-on`에는 다음과 같은 단축 문법도 있습니다:
10
10
11
11
```vue-html
12
12
<button @click="increment">{{ count }}</button>
13
13
```
14
14
15
15
<divclass="options-api">
16
16
17
-
Here, `increment` references a function declared using the `methods`option:
17
+
여기서 참조되는 `increment`는 `methods`옵션을 사용하여 선언된 함수입니다:
18
18
19
19
<divclass="sfc">
20
20
@@ -27,7 +27,7 @@ export default {
27
27
},
28
28
methods: {
29
29
increment() {
30
-
// update component state
30
+
// 컴포넌트의 count 상태 업데이트
31
31
this.count++
32
32
}
33
33
}
@@ -46,7 +46,7 @@ createApp({
46
46
},
47
47
methods: {
48
48
increment() {
49
-
// update component state
49
+
// 컴포넌트의 count 상태 업데이트
50
50
this.count++
51
51
}
52
52
}
@@ -55,15 +55,17 @@ createApp({
55
55
56
56
</div>
57
57
58
-
Inside a method, we can access the component instance using `this`. The component instance exposes the data properties declared by `data`. We can update the component state by mutating these properties.
58
+
메서드 내에서 `this`를 사용하여 컴포넌트 인스턴스에 접근할 수 있습니다.
59
+
컴포넌트 인스턴스는 `data`에 의해 선언된 데이터 속성을 노출합니다.
60
+
이러한 속성을 변경하여 컴포넌트 상태를 업데이트할 수 있습니다.
59
61
60
62
</div>
61
63
62
64
<divclass="composition-api">
63
65
64
66
<divclass="sfc">
65
67
66
-
Here, `increment` is referencing a function declared in `<script setup>`:
68
+
여기서 참조되는 `increment`는 `<script setup>`에서 선언된 함수입니다:
67
69
68
70
```vue{6-9}
69
71
<script setup>
@@ -72,7 +74,7 @@ import { ref } from 'vue'
72
74
const count = ref(0)
73
75
74
76
function increment() {
75
-
// update component state
77
+
// 컴포넌트의 count 상태 업데이트
76
78
count.value++
77
79
}
78
80
</script>
@@ -82,14 +84,14 @@ function increment() {
82
84
83
85
<divclass="html">
84
86
85
-
Here, `increment` is referencing a method in the object returned from `setup()`:
87
+
여기서 참조되는 `increment`는 `setup()`에서 반환된 객체의 메서드입니다:
86
88
87
89
```js{$}
88
90
setup() {
89
91
const count = ref(0)
90
92
91
93
function increment(e) {
92
-
// update component state
94
+
// 컴포넌트의 count 상태 업데이트
93
95
count.value++
94
96
}
95
97
@@ -102,10 +104,13 @@ setup() {
102
104
103
105
</div>
104
106
105
-
Inside the function, we can update the component state by mutating refs.
107
+
함수 내에서 ref 값을 변경하여 컴포넌트 상태를 업데이트할 수 있습니다.
106
108
107
109
</div>
108
110
109
-
Event handlers can also use inline expressions, and can simplify common tasks with modifiers. These details are covered in <atarget="_blank"href="/guide/essentials/event-handling.html">Guide - Event Handling</a>.
111
+
이벤트 핸들러는 인라인 표현식을 사용할 수도 있으며,
112
+
수식어를 사용하여 일반적인 작업을 단순화할 수 있습니다.
113
+
이러한 세부 사항은 <atarget="_blank"href="/guide/essentials/event-handling.html">가이드 - 이벤트 핸들링</a>에서 다룹니다.
110
114
111
-
Now, try to implement the `increment` <spanclass="options-api">method</span><spanclass="composition-api">function</span> yourself and bind it to the button using `v-on`.
115
+
이제 `increment` <spanclass="options-api">메소드</span><spanclass="composition-api">함수</span>를 직접 구현하고,
0 commit comments