Skip to content

Commit aaaf599

Browse files
ChangJoo Park(λ°•μ°½μ£Ό)yyx990803
ChangJoo Park(λ°•μ°½μ£Ό)
authored andcommitted
Translate vuex in Korean. (#517)
* Add Korean directory * installation * intro * getting started * state * getters * Add Korean * mutation * actions * modules * structure * strict * forms * hot-reload * plugins * api * testing * summary * update intro * Update translations
1 parent f84da30 commit aaaf599

21 files changed

+1572
-0
lines changed

β€Ždocs/LANGS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
* [2.0 - FranΓ§ais](fr/)
44
* [2.0 - Русский](ru/)
55
* [2.0 - ζ—₯本θͺž](ja/)
6+
* [2.0 - ν•œκ΅­μ–΄(Korean)](ko/)
67
* [1.0 Docs](old/)

β€Ždocs/ko/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include "./SUMMARY.md" %}

β€Ždocs/ko/SUMMARY.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Vuex
2+
3+
> μ°Έκ³ : 이 λ¬Έμ„œλŠ” vuex@2.x 을 κΈ°μ€€μœΌλ‘œ ν•©λ‹ˆλ‹€.
4+
5+
- [1.0 버전 λ¬Έμ„œλ₯Ό 보렀면?](https://github.com/vuejs/vuex/tree/1.0/docs)
6+
- [릴리즈 λ…ΈνŠΈ](https://github.com/vuejs/vuex/releases)
7+
- [μ„€μΉ˜](installation.md)
8+
- [Vuexκ°€ λ¬΄μ—‡μΈκ°€μš”?](intro.md)
9+
- [μ‹œμž‘ν•˜κΈ°](getting-started.md)
10+
- 핡심 컨셉
11+
- [μƒνƒœ](state.md)
12+
- [Getters](getters.md)
13+
- [변이](mutations.md)
14+
- [μ•‘μ…˜](actions.md)
15+
- [λͺ¨λ“ˆ](modules.md)
16+
- [μ• ν”Œλ¦¬μΌ€μ΄μ…˜ ꡬ쑰](structure.md)
17+
- [ν”ŒλŸ¬κ·ΈμΈ](plugins.md)
18+
- [Strict λͺ¨λ“œ](strict.md)
19+
- [폼 핸듀링](forms.md)
20+
- [ν…ŒμŠ€νŒ…](testing.md)
21+
- [ν•« λ¦¬λ‘œλ”©](hot-reload.md)
22+
- [API 레퍼런슀](api.md)

β€Ždocs/ko/actions.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# μ•‘μ…˜
2+
3+
μ•‘μ…˜μ€ 변이와 μœ μ‚¬ν•©λ‹ˆλ‹€. λͺ‡κ°€μ§€ λ‹€λ₯Έ 점은,
4+
5+
- μƒνƒœλ₯Ό λ³€μ΄μ‹œν‚€λŠ” λŒ€μ‹  μ•‘μ…˜μœΌλ‘œ 변이에 λŒ€ν•œ 컀밋을 ν•©λ‹ˆλ‹€.
6+
- μž‘μ—…μ—λŠ” μž„μ˜μ˜ 비동기 μž‘μ—…μ΄ 포함될 수 μžˆμŠ΅λ‹ˆλ‹€.
7+
8+
κ°„λ‹¨ν•œ μ•‘μ…˜μ„ λ“±λ‘ν•©μ‹œλ‹€.
9+
10+
``` js
11+
const store = new Vuex.Store({
12+
state: {
13+
count: 0
14+
},
15+
mutations: {
16+
increment (state) {
17+
state.count++
18+
}
19+
},
20+
actions: {
21+
increment (context) {
22+
context.commit('increment')
23+
}
24+
}
25+
})
26+
```
27+
28+
μ•‘μ…˜ ν•Έλ“€λŸ¬λŠ” μ €μž₯μ†Œ μΈμŠ€ν„΄μŠ€μ˜ 같은 λ©”μ†Œλ“œλ“€/ν”„λ‘œνΌν‹° μ„ΈνŠΈλ₯Ό λ“œλŸ¬λ‚΄λŠ” μ»¨ν…μŠ€νŠΈ 객체λ₯Ό λ°›μŠ΅λ‹ˆλ‹€. κ·Έλž˜μ„œ `context.commit`을 ν˜ΈμΆœν•˜μ—¬ 변이λ₯Ό μ»€λ°‹ν•˜κ±°λ‚˜ `context.state`와 `context.getters`λ₯Ό 톡해 μƒνƒœμ™€ getters에 μ ‘κ·Ό ν•  수 μžˆμŠ΅λ‹ˆλ‹€. λ‚˜μ€‘μ— [λͺ¨λ“ˆ](modules.md)μ—μ„œ 이 μ»¨ν…μŠ€νŠΈ 객체가 μ €μž₯μ†Œ μΈμŠ€ν„΄μŠ€ μžμ²΄κ°€ μ•„λ‹Œ 이유λ₯Ό μ•Œ 수 μžˆμŠ΅λ‹ˆλ‹€.
29+
30+
μ‹€μ œλ‘œ (특히 `commit`λ₯Ό μ—¬λŸ¬ 번 ν˜ΈμΆœν•΄μ•Όν•˜λŠ” 경우)μ½”λ“œλ₯Ό λ‹¨μˆœν™”ν•˜κΈ° μœ„ν•΄ ES2015 [μ „λ‹¬μΈμž λΆ„ν•΄](https://github.com/lukehoban/es6features#destructuring)λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.
31+
32+
``` js
33+
actions: {
34+
increment ({ commit }) {
35+
commit('increment')
36+
}
37+
}
38+
```
39+
40+
### λ””μŠ€νŒ¨μΉ˜ μ•‘μ…˜
41+
42+
μ•‘μ…˜μ€ `store.dispatch` λ©”μ†Œλ“œλ‘œ μ‹œμž‘λ©λ‹ˆλ‹€.
43+
44+
``` js
45+
store.dispatch('increment')
46+
```
47+
48+
처음 λ³Ό λ•ŒλŠ” 이상해 보일 수 μžˆμŠ΅λ‹ˆλ‹€. 카운트λ₯Ό 증가 μ‹œν‚€λ €λ©΄ `store.commit('increment')`λ₯Ό 직접 ν˜ΈμΆœν•˜λ©΄ μ–΄λ–»μŠ΅λ‹ˆκΉŒ? 음, **λŒμ—°λ³€μ΄λŠ” 동기적** 이어야 ν•œλ‹€λŠ” 것을 κΈ°μ–΅ν•˜μ‹­λ‹ˆκΉŒ? μ•‘μ…˜μ€ κ·Έλ ‡μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ•‘μ…˜ λ‚΄μ—μ„œ **비동기** μž‘μ—…μ„ μˆ˜ν–‰ ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
49+
50+
``` js
51+
actions: {
52+
incrementAsync ({ commit }) {
53+
setTimeout(() => {
54+
commit('increment')
55+
}, 1000)
56+
}
57+
}
58+
```
59+
60+
μ•‘μ…˜μ€ λ™μΌν•œ νŽ˜μ΄λ‘œλ“œ νƒ€μž…κ³Ό 객체 μŠ€νƒ€μΌμ˜ λ””μŠ€νŒ¨μΉ˜λ₯Ό μ§€μ›ν•©λ‹ˆλ‹€.
61+
62+
``` js
63+
// νŽ˜μ΄λ‘œλ“œμ™€ ν•¨κ»˜ λ””μŠ€νŒ¨μΉ˜
64+
store.dispatch('incrementAsync', {
65+
amount: 10
66+
})
67+
68+
// 객체와 ν•¨κ»˜ λ””μŠ€νŒ¨μΉ˜
69+
store.dispatch({
70+
type: 'incrementAsync',
71+
amount: 10
72+
})
73+
```
74+
75+
μ•‘μ…˜μ˜ μ’€ 더 μ‹€μš©μ μΈ μ˜ˆλŠ” **비동기 API 호좜** κ³Ό **μ—¬λŸ¬ 개의 변이λ₯Ό 컀밋** ν•˜λŠ” μž₯λ°”κ΅¬λ‹ˆ κ²°μ œμž…λ‹ˆλ‹€.
76+
77+
``` js
78+
actions: {
79+
checkout ({ commit, state }, products) {
80+
// μž₯λ°”κ΅¬λ‹ˆμ— ν˜„μž¬μžˆλŠ” ν•­λͺ©μ„ μ €μž₯ν•˜μ‹­μ‹œμ˜€.
81+
const savedCartItems = [...state.cart.added]
82+
83+
// 결제 μš”μ²­μ„ 보낸 ν›„ μž₯λ°”κ΅¬λ‹ˆλ₯Ό λΉ„μ›λ‹ˆλ‹€.
84+
commit(types.CHECKOUT_REQUEST)
85+
86+
// 상점 APIλŠ” 성곡 콜백 및 μ‹€νŒ¨ μ½œλ°±μ„ λ°›μŠ΅λ‹ˆλ‹€.
87+
shop.buyProducts(
88+
products,
89+
// μš”μ²­ 성곡 ν•Έλ“€λŸ¬
90+
() => commit(types.CHECKOUT_SUCCESS),
91+
// μš”μ²­ μ‹€νŒ¨ ν•Έλ“€λŸ¬
92+
() => commit(types.CHECKOUT_FAILURE, savedCartItems)
93+
)
94+
}
95+
}
96+
```
97+
98+
비동기 μž‘μ—…μ˜ 흐름을 μˆ˜ν–‰ν•˜κ³  μ»€λ°‹ν•˜μ—¬ μž‘μ—…μ˜ μ‚¬μ΄λ“œμ΄νŽ™νŠΈ(μƒνƒœ 변이)을 κΈ°λ‘ν•©λ‹ˆλ‹€.
99+
100+
### μ»΄ν¬λ„ŒνŠΈ λ‚΄λΆ€μ—μ„œ λ””μŠ€νŒ¨μΉ˜ μ•‘μ…˜ μ‚¬μš©ν•˜κΈ°
101+
102+
`this.$store.dispatch('xxx')`λ₯Ό μ‚¬μš©ν•˜μ—¬ μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ•‘μ…˜μ„ λ””μŠ€νŒ¨μΉ˜ν•˜κ±°λ‚˜ μ»΄ν¬λ„ŒνŠΈ λ©”μ†Œλ“œλ₯Ό `store.dispatch` ν˜ΈμΆœμ— λ§€ν•‘ν•˜λŠ” `mapActions` 헬퍼λ₯Ό μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€ (루트 `store` μ£Όμž… ν•„μš”) :
103+
104+
``` js
105+
import { mapActions } from 'vuex'
106+
107+
export default {
108+
// ...
109+
methods: {
110+
...mapActions([
111+
'increment' // this.increment()을 this.$store.dispatch('increment')에 λ§€ν•‘
112+
]),
113+
...mapActions({
114+
add: 'increment' // this.add()을 this.$store.dispatch('increment')에 λ§€ν•‘
115+
})
116+
}
117+
}
118+
```
119+
120+
### μ•‘μ…˜ κ΅¬μ„±ν•˜κΈ°
121+
122+
μ•‘μ…˜μ€ μ’…μ’… 비동기적 μž…λ‹ˆλ‹€. 그러면 μ•‘μ…˜μ΄ μ–Έμ œ μ™„λ£Œλ˜λŠ”μ§€ μ–΄λ–»κ²Œ μ•Œ 수 μžˆμŠ΅λ‹ˆκΉŒ? 더 μ€‘μš”ν•œ 것은, λ³΅μž‘ν•œ 비동기 흐름을 μ²˜λ¦¬ν•˜κΈ° μœ„ν•΄ μ–΄λ–»κ²Œ μ—¬λŸ¬ μž‘μ—…μ„ ν•¨κ»˜ ꡬ성 ν•  수 μžˆμŠ΅λ‹ˆκΉŒ?
123+
124+
κ°€μž₯ λ¨Όμ € μ•Œμ•„μ•Ό ν•  점은 `store.dispatch`κ°€ 트리거 된 μ•‘μ…˜ ν•Έλ“€λŸ¬μ— μ˜ν•΄ λ°˜ν™˜λœ Promiseλ₯Ό 처리 ν•  수 있으며 Promiseλ₯Ό λ°˜ν™˜ν•œλ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€.
125+
126+
``` js
127+
actions: {
128+
actionA ({ commit }) {
129+
return new Promise((resolve, reject) => {
130+
setTimeout(() => {
131+
commit('someMutation')
132+
resolve()
133+
}, 1000)
134+
})
135+
}
136+
}
137+
```
138+
139+
μ΄λ ‡κ²Œ ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
140+
141+
``` js
142+
store.dispatch('actionA').then(() => {
143+
// ...
144+
})
145+
```
146+
147+
그리고 μ•ˆμ— 또 λ‹€λ₯Έ μ•‘μ…˜μ„ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
148+
149+
``` js
150+
actions: {
151+
// ...
152+
actionB ({ dispatch, commit }) {
153+
return dispatch('actionA').then(() => {
154+
commit('someOtherMutation')
155+
})
156+
}
157+
}
158+
```
159+
160+
λ§ˆμ§€λ§‰μœΌλ‘œ, JavaScript κΈ°λŠ₯인 [async/await](https://tc39.github.io/ecmascript-asyncawait/)λ₯Ό μ‚¬μš©ν•˜λ©΄ λ‹€μŒκ³Ό 같은 μž‘μ—…μ„ ꡬ성 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
161+
162+
``` js
163+
// getData() 및 getOtherData()κ°€ Promiseλ₯Ό λ°˜ν™˜ν•œλ‹€κ³  κ°€μ •ν•©λ‹ˆλ‹€.
164+
actions: {
165+
async actionA ({ commit }) {
166+
commit('gotData', await getData())
167+
},
168+
async actionB ({ dispatch, commit }) {
169+
await dispatch('actionA') // actionAκ°€ λλ‚˜κΈ°λ₯Ό κΈ°λ‹€λ¦½λ‹ˆλ‹€.
170+
commit('gotOtherData', await getOtherData())
171+
}
172+
}
173+
```
174+
175+
> `store.dispatch`κ°€ λ‹€λ₯Έ λͺ¨λ“ˆμ—μ„œ μ—¬λŸ¬ μ•‘μ…˜ ν•Έλ“€λŸ¬λ₯Ό νŠΈλ¦¬κ±°ν•˜λŠ” 것이 κ°€λŠ₯ν•©λ‹ˆλ‹€. 이 경우 λ°˜ν™˜ 된 값은 λͺ¨λ“  트리거 된 μ²˜λ¦¬κΈ°κ°€ μ™„λ£Œ λ˜μ—ˆμ„ λ•Œ μ²˜λ¦¬λ˜λŠ” Promiseμž…λ‹ˆλ‹€.

β€Ždocs/ko/api.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# API 레퍼런슀
2+
3+
### Vuex.Store
4+
5+
``` js
6+
import Vuex from 'vuex'
7+
8+
const store = new Vuex.Store({ ...options })
9+
```
10+
11+
### Vuex.Store μƒμ„±μž μ˜΅μ…˜
12+
13+
- **state**
14+
15+
- μžλ£Œν˜•: `Object`
16+
17+
Vuex μ €μž₯μ†Œμ˜ 루트 μƒνƒœ 객체 μž…λ‹ˆλ‹€.
18+
19+
[상세](state.md)
20+
21+
- **mutations**
22+
23+
- μžλ£Œν˜•: `{ [type: string]: Function }`
24+
25+
μ €μž₯μ†Œμ— 변이λ₯Ό λ“±λ‘ν•˜μ‹­μ‹œμ˜€. ν•Έλ“€λŸ¬ ν•¨μˆ˜λŠ” 항상 첫 번째 μ „λ‹¬μΈμžλ‘œ `state`λ₯Ό λ°›μŠ΅λ‹ˆλ‹€ (λͺ¨λ“ˆμ— μ •μ˜ 된 경우 λͺ¨λ“ˆ 둜컬 μƒνƒœκ°€λ©λ‹ˆλ‹€). 두 번째 `payload` μ „λ‹¬μΈμžκ°€ 있으면 μ²˜λ¦¬ν•©λ‹ˆλ‹€.
26+
27+
[상세](mutations.md)
28+
29+
- **actions**
30+
31+
- μžλ£Œν˜•: `{ [type: string]: Function }`
32+
33+
μ €μž₯μ†Œμ— μ•‘μ…˜μ„ λ“±λ‘ν•˜μ‹­μ‹œμ˜€. ν•Έλ“€λŸ¬ ν•¨μˆ˜λŠ” λ‹€μŒ 속성을 λ…ΈμΆœν•˜λŠ” `context` 객체λ₯Όλ°›μŠ΅λ‹ˆλ‹€.
34+
35+
``` js
36+
{
37+
state, // store.state와 κ°™μŠ΅λ‹ˆλ‹€. λ˜λŠ” λͺ¨λ“ˆμ— μžˆλŠ” 경우 둜컬 μƒνƒœ
38+
rootState, // store.state와 κ°™μŠ΅λ‹ˆλ‹€. λͺ¨λ“ˆ μ•ˆμ—λ§Œ μ‘΄μž¬ν•©λ‹ˆλ‹€
39+
commit, // store.commit와 κ°™μŠ΅λ‹ˆλ‹€.
40+
dispatch, // store.dispatch와 κ°™μŠ΅λ‹ˆλ‹€.
41+
getters // store.getters와 κ°™μŠ΅λ‹ˆλ‹€.
42+
}
43+
```
44+
45+
[상세](actions.md)
46+
47+
- **getters**
48+
49+
- μžλ£Œν˜•: `{ [key: string]: Function }`
50+
51+
μ €μž₯μ†Œμ— getterλ₯Ό λ“±λ‘ν•˜μ‹­μ‹œμ˜€. getter ν•¨μˆ˜λŠ” λ‹€μŒ μ „λ‹¬μΈμžλ₯Ό λ°›μŠ΅λ‹ˆλ‹€.
52+
53+
```
54+
state, // λͺ¨λ“ˆμ— μ •μ˜ 된 경우 λͺ¨λ“ˆ 둜컬 μƒνƒœκ°€λ©λ‹ˆλ‹€.
55+
getters, // store.getters와 κ°™μŠ΅λ‹ˆλ‹€.
56+
rootState // store.state와 κ°™μŠ΅λ‹ˆλ‹€.
57+
```
58+
59+
λ“±λ‘λœ getterλŠ” `store.getters`에 λ…ΈμΆœλ©λ‹ˆλ‹€.
60+
61+
[상세](getters.md)
62+
63+
- **modules**
64+
65+
- μžλ£Œν˜•: `Object`
66+
67+
μ €μž₯μ†Œμ— 병합될 ν•˜μœ„ λͺ¨λ“ˆμ„ ν¬ν•¨ν•˜λŠ” 객체 μž…λ‹ˆλ‹€.
68+
69+
``` js
70+
{
71+
key: {
72+
state,
73+
mutations,
74+
actions?,
75+
getters?,
76+
modules?
77+
},
78+
...
79+
}
80+
```
81+
82+
각 λͺ¨λ“ˆμ€ 루트 μ˜΅μ…˜κ³Ό λΉ„μŠ·ν•œ `state` 와 `mutations` λ₯Ό 포함 ν•  수 μžˆμŠ΅λ‹ˆλ‹€. λͺ¨λ“ˆμ˜ μƒνƒœλŠ” λͺ¨λ“ˆμ˜ ν‚€λ₯Ό μ‚¬μš©ν•˜μ—¬ μ €μž₯μ†Œμ˜ 루트 μƒνƒœμ— μ—°κ²°λ©λ‹ˆλ‹€. λͺ¨λ“ˆμ˜ 변이와 getterλŠ” λͺ¨λ“ˆμ˜ 둜컬 μƒνƒœλ₯Ό 루트 μƒνƒœ λŒ€μ‹  첫 번째 μ „λ‹¬μΈμžλ‘œ λ°›μœΌλ©° λͺ¨λ“ˆ μ•‘μ…˜μ˜ `context.state`도 둜컬 μƒνƒœλ₯Ό 가리 ν‚΅λ‹ˆλ‹€.
83+
84+
[상세](modules.md)
85+
86+
- **plugins**
87+
88+
- μžλ£Œν˜•: `Array<Function>`
89+
90+
μ €μž₯μ†Œμ— 적용 ν•  ν”ŒλŸ¬κ·ΈμΈ ν•¨μˆ˜μ˜ λ°°μ—΄μž…λ‹ˆλ‹€. ν”ŒλŸ¬κ·ΈμΈμ€ μ €μž₯μ†Œλ₯Ό μœ μΌν•œ μ „λ‹¬μΈμžλ‘œ 받아듀이고 μ•„μ›ƒλ°”μš΄λ“œ 데이터 지속성, λ‘œκΉ… λ˜λŠ” 디버깅을 μœ„ν•œ 변이λ₯Ό κ°μ‹œν•˜κ±°λ‚˜ (μΈλ°”μš΄λ“œ 데이터 (예: μ›Ή μ†ŒμΌ“ λ˜λŠ” κ΄€μ°° κ°€λŠ₯ ν•­λͺ©)의 λ””μŠ€νŒ¨μΉ˜ 변이) κ°μ‹œν•  수 μžˆμŠ΅λ‹ˆλ‹€.
91+
92+
[상세](plugins.md)
93+
94+
- **strict**
95+
96+
- μžλ£Œν˜•: `Boolean`
97+
- κΈ°λ³Έκ°’: `false`
98+
99+
Vuex μ €μž₯μ†Œλ₯Ό strict λͺ¨λ“œλ‘œ λ³€κ²½ν•©λ‹ˆλ‹€. strict λͺ¨λ“œμ—μ„œ 변이 ν•Έλ“€λŸ¬ μ™ΈλΆ€μ˜ Vuex μƒνƒœμ— λŒ€ν•œ μž„μ˜μ˜ λ³€μ΄λŠ” 였λ₯˜λ₯Ό λ°œμƒμ‹œν‚΅λ‹ˆλ‹€.
100+
101+
[상세](strict.md)
102+
103+
### Vuex.Store μΈμŠ€ν„΄μŠ€ 속성
104+
105+
- **state**
106+
107+
- μžλ£Œν˜•: `Object`
108+
109+
루트 μƒνƒœ. 읽기 μ „μš©
110+
111+
- **getters**
112+
113+
- μžλ£Œν˜•: `Object`
114+
115+
λ“±λ‘λœ getters μž…λ‹ˆλ‹€. 읽기 μ „μš©.
116+
117+
### Vuex.Store μΈμŠ€ν„΄μŠ€ λ©”μ†Œλ“œ
118+
119+
- **`commit(type: string, payload?: any) | commit(mutation: Object)`**
120+
121+
변이λ₯Ό μ»€λ°‹ν•©λ‹ˆλ‹€. [상세](mutations.md)
122+
123+
- **`dispatch(type: string, payload?: any) | dispatch(action: Object)`**
124+
125+
μ•‘μ…˜μ„ λ””μŠ€νŒ¨μΉ˜ ν•©λ‹ˆλ‹€. λͺ¨λ“  트리거된 μ•‘μ…˜ ν•Έλ“€λŸ¬λ₯Ό μ²˜λ¦¬ν•˜λŠ” Promiseλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€. [상세](actions.md)
126+
127+
- **`replaceState(state: Object)`**
128+
129+
μ €μž₯μ†Œμ˜ 루트 μƒνƒœλ₯Ό λ°”κΏ‰λ‹ˆλ‹€. μƒνƒœμ— λŒ€ν•œ μƒν˜Έμž‘μš©/μ‹œμ  λ³€κ²½ λͺ©μ μœΌλ‘œ 만 μ‚¬μš©ν•˜μ‹­μ‹œμ˜€.
130+
131+
- **`watch(getter: Function, cb: Function, options?: Object)`**
132+
133+
getter ν•¨μˆ˜μ˜ λ°˜ν™˜ 값을 λ°˜μ‘μ μœΌλ‘œ μ§€μΌœλ³΄κ³  값이 λ³€κ²½λ˜λ©΄ μ½œλ°±μ„ ν˜ΈμΆœν•©λ‹ˆλ‹€. getterλŠ” μ €μž₯μ†Œμ˜ μƒνƒœλ₯Ό μœ μΌν•œ μΈμˆ˜λ‘œλ°›μŠ΅λ‹ˆλ‹€. Vue의 `vm.$watch` λ©”μ†Œλ“œμ™€ 같은 μ˜΅μ…˜μ„ μ·¨ν•˜λŠ” μ˜΅μ…˜ 객체λ₯Ό λ°›μ•„λ“€μž…λ‹ˆλ‹€.
134+
135+
κ°μ‹œλ₯Ό μ€‘λ‹¨ν•˜λ €λ©΄ λ°˜ν™˜λœ ν•Έλ“€ ν•¨μˆ˜λ₯Ό ν˜ΈμΆœν•˜μ‹­μ‹œμ˜€.
136+
137+
- **`subscribe(handler: Function)`**
138+
139+
μ €μž₯μ†Œ 변이λ₯Ό κ΅¬λ…ν•©λ‹ˆλ‹€. `handler`λŠ” λͺ¨λ“  변이 이후 호좜되고 변이 λ””μŠ€ν¬λ¦½ν„°μ™€ 변이 μƒνƒœλ₯Ό μ „λ‹¬μΈμžλ‘œ λ°›μŠ΅λ‹ˆλ‹€.
140+
141+
``` js
142+
store.subscribe((mutation, state) => {
143+
console.log(mutation.type)
144+
console.log(mutation.payload)
145+
})
146+
```
147+
148+
ν”ŒλŸ¬κ·ΈμΈμ—μ„œ κ°€μž₯ 일반적으둜 μ‚¬μš©λ©λ‹ˆλ‹€. [상세](plugins.md)
149+
150+
- **`registerModule(path: string | Array<string>, module: Module)`**
151+
152+
동적 λͺ¨λ“ˆμ„ λ“±λ‘ν•©λ‹ˆλ‹€. [상세](modules.md#dynamic-module-registration)
153+
154+
- **`unregisterModule(path: string | Array<string>)`**
155+
156+
동적 λͺ¨λ“ˆμ„ ν•΄μ œ ν•©λ‹ˆλ‹€. [상세](modules.md#dynamic-module-registration)
157+
158+
- **`hotUpdate(newOptions: Object)`**
159+
160+
μƒˆ μ•‘μ…˜κ³Ό 변이λ₯Ό ν•« μŠ€μ™‘ ν•©λ‹ˆλ‹€. [상세](hot-reload.md)
161+
162+
### μ»΄ν¬λ„ŒνŠΈ 바인딩 헬퍼
163+
164+
- **`mapState(map: Array<string> | Object): Object`**
165+
166+
Vuex μ €μž₯μ†Œμ˜ ν•˜μœ„ 트리λ₯Ό λ°˜ν™˜ν•˜λŠ” μ»΄ν¬λ„ŒνŠΈ 계산 μ˜΅μ…˜μ„ λ§Œλ“­λ‹ˆλ‹€. [상세](state.md#the-mapstate-helper)
167+
168+
- **`mapGetters(map: Array<string> | Object): Object`**
169+
170+
getter의 ν‰κ°€λœ 값을 λ°˜ν™˜ν•˜λŠ” μ»΄ν¬λ„ŒνŠΈ 계산 μ˜΅μ…˜μ„ λ§Œλ“­λ‹ˆλ‹€. [상세](getters.md#the-mapgetters-helper)
171+
172+
- **`mapActions(map: Array<string> | Object): Object`**
173+
174+
μ•‘μ…˜μ„ μ „λ‹¬ν•˜λŠ” μ»΄ν¬λ„ŒνŠΈ λ©”μ†Œλ“œ μ˜΅μ…˜μ„ λ§Œλ“­λ‹ˆλ‹€. [상세](actions.md#dispatching-actions-in-components)
175+
176+
- **`mapMutations(map: Array<string> | Object): Object`**
177+
178+
변이λ₯Ό μ»€λ°‹ν•˜λŠ” μ»΄ν¬λ„ŒνŠΈ λ©”μ†Œλ“œ μ˜΅μ…˜μ„ λ§Œλ“­λ‹ˆλ‹€. [상세](mutations.md#commiting-mutations-in-components)

0 commit comments

Comments
Β (0)