Skip to content

Commit b95ad48

Browse files
authored
Merge pull request #55 from dear-lizhihua/2.0-cn
Global Config
2 parents 658acfb + 7118406 commit b95ad48

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/api/index.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
type: api
33
---
44

5-
## Global Config
5+
## 全局配置
66

7-
`Vue.config` is an object containing Vue's global configurations. You can modify its properties listed below before bootstrapping your application:
7+
`Vue.config` is 是一个对象,包含 Vue 的全局配置。可以在启动应用之前修改下列属性:
88

99
### silent
1010

11-
- **Type:** `boolean`
11+
- **类型:** `boolean`
1212

13-
- **Default:** `false`
13+
- **默认值:** `false`
1414

15-
- **Usage:**
15+
- **用法:**
1616

1717
``` js
1818
Vue.config.silent = true
1919
```
2020

21-
Suppress all Vue logs and warnings.
21+
取消 Vue 所有的日志与警告。
2222

2323
### optionMergeStrategies
2424

25-
- **Type:** `{ [key: string]: Function }`
25+
- **类型:** `{ [key: string]: Function }`
2626

27-
- **Default:** `{}`
27+
- **默认值:** `{}`
2828

29-
- **Usage:**
29+
- **用法:**
3030

3131
``` js
3232
Vue.config.optionMergeStrategies._my_option = function (parent, child, vm) {
@@ -40,56 +40,56 @@ type: api
4040
// Profile.options._my_option = 2
4141
```
4242

43-
Define custom merging strategies for options.
43+
自定义选项的混合策略。
4444

45-
The merge strategy receives the value of that option defined on the parent and child instances as the first and second arguments, respectively. The context Vue instance is passed as the third argument.
45+
合并策略函数接收定义在父实例和子实例上的 option,分别作为第一个和第二个参数的值,Vue实例上下文被作为第三个参数传入。
4646

47-
- **See also**: [Custom Option Merging Strategies](/guide/mixins.html#Custom-Option-Merge-Strategies)
47+
- **参考**: [自定义选项的混合策略](/guide/mixins.html#Custom-Option-Merge-Strategies)
4848

4949
### devtools
5050

51-
- **Type:** `boolean`
51+
- **类型:** `boolean`
5252

53-
- **Default:** `true` (`false` in production builds)
53+
- **默认值:** `true` (生产版为 `false`)
5454

55-
- **Usage:**
55+
- **用法:**
5656

5757
``` js
58-
// make sure to set this synchronously immediately after loading Vue
58+
// 务必在加载 Vue 之后,立即同步设置以下内容
5959
Vue.config.devtools = true
6060
```
6161

62-
Configure whether to allow [vue-devtools](https://github.com/vuejs/vue-devtools) inspection. This option's default value is `true` in development builds and `false` in production builds. You can set it to `true` to enable inspection for production builds.
62+
配置是否允许 [vue-devtools](https://github.com/vuejs/vue-devtools) 检查代码。开发版本默认为 `true`,生产版本默认为 `false`。生产版本设为 `true` 可以启用检查。
6363

6464
### errorHandler
6565

66-
- **Type:** `Function`
66+
- **类型:** `Function`
6767

68-
- **Default:** Error is thrown in place
68+
- **默认值:** 默认抛出错误
6969

70-
- **Usage:**
70+
- **用法:**
7171

7272
``` js
7373
Vue.config.errorHandler = function (err, vm) {
7474
// handle error
7575
}
7676
```
7777

78-
Assign a handler for uncaught errors during component render and watchers. The handler gets called with the error and the Vue instance.
78+
指定组件的渲染和观察期间未捕获错误的处理函数。处理函数被调用时,可获取错误信息和 Vue 实例。
7979

8080
### keyCodes
8181

82-
- **Type:** `{ [key: string]: number }`
82+
- **类型:** `{ [key: string]: number }`
8383

84-
- **Default:** `{}`
84+
- **默认值:** `{}`
8585

86-
- **Usage:**
86+
- **用法:**
8787

8888
``` js
8989
Vue.config.keyCodes = { esc: 27 }
9090
```
9191

92-
Define custom key aliases for v-on.
92+
自定义 v-on 键位别名。
9393

9494
## Global API
9595

src/guide/state-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ var vmB = new Vue({
7575

7676
接着我们继续延伸约定,组件不允许直接修改属于 store 实例的 state,而是应该使用分发 (dispatch) 事件通知 store 执行 action 作为替代,我们最终达成了 [Flux](https://facebook.github.io/flux/) 架构。这样约定的好处是,我们能够记录所有 store 中发生的 state 改变,同时实现能做到记录变更 (mutation) 、保存状态快照、历史回滚/时光旅行的先进的调试工具。
7777

78-
[vuex](https://github.com/vuejs/vuex)给我们带来了整个循环,如果你读了这么久,不妨去尝试一下它!
78+
[vuex](https://github.com/vuejs/vuex) 给我们带来了整个循环机制,如果你读了这么久,不妨去尝试一下它!

0 commit comments

Comments
 (0)