File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ import { SOME_MUTATION } from './mutation-types'
96
96
const store = createStore ({
97
97
state: { ... },
98
98
mutations: {
99
- // we can use the ES2015 computed property name feature to use a constant as the function name
99
+ // we can use the ES2015 computed property name feature
100
+ // to use a constant as the function name
100
101
[SOME_MUTATION ] (state ) {
101
102
// mutate state
102
103
}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const store = createStore({
40
40
41
41
## 通过属性访问
42
42
43
- getter 会暴露为 ` store.getters ` 对象,你可以以属性的形式访问这些值:
43
+ Getter 会暴露为 ` store.getters ` 对象,你可以以属性的形式访问这些值:
44
44
45
45
``` js
46
46
store .getters .doneTodos // -> [{ id: 1, text: '...', done: true }]
Original file line number Diff line number Diff line change 1
- # Mutations
1
+ # Mutation
2
2
3
3
<div class =" scrimba " ><a href =" https://scrimba.com/p/pnyzgAP/ckMZp4HN " target =" _blank " rel =" noopener noreferrer " >在 Scrimba 上尝试这节课</a ></div >
4
4
@@ -96,7 +96,8 @@ import { SOME_MUTATION } from './mutation-types'
96
96
const store = createStore ({
97
97
state: { ... },
98
98
mutations: {
99
- // 我们可以使用 ES2015 风格的计算属性命名功能来使用一个常量作为函数名
99
+ // 我们可以使用 ES2015 风格的计算属性命名功能
100
+ // 来使用一个常量作为函数名
100
101
[SOME_MUTATION ] (state ) {
101
102
// 修改 state
102
103
}
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ describe('actions', () => {
127
127
})
128
128
```
129
129
130
- 如果在测试环境下有可用的 spies (比如通过 [ Sinon.JS] ( http://sinonjs.org/ ) ),你可以使用它们替换辅助函数 ` testAction ` :
130
+ 如果在测试环境下有可用的 spy (比如通过 [ Sinon.JS] ( http://sinonjs.org/ ) ),你可以使用它们替换辅助函数 ` testAction ` :
131
131
132
132
``` js
133
133
describe (' actions' , () => {
You can’t perform that action at this time.
0 commit comments