Skip to content

Commit e2c5a5d

Browse files
committed
[docs][zh] translated options.md
1 parent 6dcaf02 commit e2c5a5d

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = {
6868
link: '/zh/spec.html'
6969
},
7070
{
71-
text: '选项手册',
71+
text: '选项参考',
7272
link: '/zh/options.html'
7373
},
7474
{

docs/zh/options.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
sidebar: auto
33
---
44

5-
# Options Reference
5+
# 选项参考
66

77
## transformAssetUrls
88

9-
- type: `{ [tag: string]: string | Array<string> }`
10-
- default:
9+
- 类型:`{ [tag: string]: string | Array<string> }`
10+
- 默认值:
1111

1212
``` js
1313
{
@@ -18,52 +18,52 @@ sidebar: auto
1818
}
1919
```
2020

21-
During template compilation, the compiler can transform certain attributes, such as `src` URLs, into `require` calls, so that the target asset can be handled by webpack. For example, `<img src="./foo.png">` will attempt to locate the file `./foo.png` on your file system and include it as a dependency of your bundle.
21+
在模板编译过程中,编译器可以将某些特性转换为 `require` 调用,例如 `src` 中的 URL。因此这些目标资源可以被 webpack 处理。例如 `<img src="./foo.png">` 会找到你文件系统中的 `./foo.png` 并将其作为一个依赖包含在你的包里。
2222

2323
## compiler
2424

25-
- Type: `VueTemplateCompiler`
26-
- default: `require('vue-template-compiler')`
25+
- 类型:`VueTemplateCompiler`
26+
- 默认值:`require('vue-template-compiler')`
2727

28-
Override the default compiler used to compile `<template>` blocks in single file components.
28+
覆写用来编译单文件组件中 `<template>` 块的默认编译器。
2929

3030
## compilerOptions
3131

32-
- type: `Object`
33-
- default: `{}`
32+
- 类型:`Object`
33+
- 默认值:`{}`
3434

35-
Options for the template compiler. When using the default `vue-template-compiler`, you can use this option to add custom compiler directives, modules, or discard whitespaces between template tags with `{ preserveWhitespace: false }`.
35+
模板编译器的选项。当使用默认的 `vue-template-compiler` 的时候,你可以使用这个选项来添加自定义编译器指令、模块或通过 `{ preserveWhitespace: false }` 放弃模板标签之间的空格。
3636

37-
See [`vue-template-compiler` options reference](https://github.com/vuejs/vue/tree/dev/packages/vue-template-compiler#options).
37+
详情查阅 [`vue-template-compiler` 选项参考](https://github.com/vuejs/vue-docs-zh-cn/blob/master/vue-template-compiler/README.md#选项).
3838

3939
## transpileOptions
4040

41-
- type: `Object`
42-
- default: `{}`
41+
- 类型:`Object`
42+
- 默认值:`{}`
4343

44-
Configure ES2015+ to ES5 transpiling options for the generated render function code. The [transpiler](https://github.com/vuejs/vue-template-es2015-compiler) is a fork of [Buble](https://github.com/Rich-Harris/buble), so consult the available options [here](https://buble.surge.sh/guide/#using-the-javascript-api).
44+
为渲染函数的生成码配置从 ES2015+ ES5 的转译选项。这里的[转译器](https://github.com/vuejs/vue-template-es2015-compiler)是一份 [Buble](https://github.com/Rich-Harris/buble) 的 fork,因此你可以在[这里](https://buble.surge.sh/guide/#using-the-javascript-api)咨询可用的选项。
4545

46-
The template render functions compilation supports a special transform `stripWith` (enabled by default), which removes the `with` usage in generated render functions to make them strict-mode compliant. This is enabled by default.
46+
模板渲染函数编译支持一个特殊的变换 `stripWith` (默认启用),它删除生成的渲染函数中的 `with` 用法,使它们兼容严格模式。
4747

4848
## optimizeSSR
4949

50-
- type: `boolean`
51-
- default: `true` when the webpack config has `target: 'node'` and `vue-template-compiler` is at version 2.4.0 or above.
50+
- 类型:`boolean`
51+
- 默认值:当 webpack 配置中包含 `target: 'node'` `vue-template-compiler` 版本号大于等于 2.4.0 时为 `true`
5252

53-
Enable Vue 2.4 SSR compilation optimization that compiles part of the vdom trees returned by render functions into plain strings, which improves SSR performance. In some cases you might want to explicitly turn it off because the resulting render functions can only be used for SSR and cannot be used for client-side rendering or testing.
53+
开启 Vue 2.4 服务端渲染的编译优化之后,渲染函数将会把返回的 vdom 树的一部分编译为字符串,以提升服务端渲染的性能。在一些情况下,你可能想要明确的将其关掉,因为该渲染函数只能用于服务端渲染,而不能用于客户端渲染或测试环境。
5454

5555
## hotReload
5656

57-
- type: `boolean`
58-
- default: `true` in development mode, `false` in production mode or when the webpack config has `target: 'node'`.
59-
- allowed value: `false` (`true` will not force Hot Reload neither in production mode nor when `target: 'node'`)
57+
- 类型:`boolean`
58+
- 默认值:在开发环境下是 `true`,在生产环境下或 webpack 配置中有 `target: 'node'` 的时候是 `false`
59+
- 允许的值:`false` (`true` 会强制热重载,即便是生产环境或 `target: 'node'`)
6060

61-
Whether to use webpack [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) to apply changes in the browser **without reloading the page**.
62-
Use this option (value `false`) to disable the Hot Reload feature in development mode.
61+
是否使用 webpack [模块热替换](https://webpack.js.org/concepts/hot-module-replacement/)在浏览器中应用变更而**不重载整个页面**
62+
用这个选项 (值设为 `false`) 在开发环境下关闭热重载特性。
6363

6464
## productionMode
6565

66-
- type: `boolean`
67-
- default: `process.env.NODE_ENV === 'production'`
66+
- 类型:`boolean`
67+
- 默认值:`process.env.NODE_ENV === 'production'`
6868

69-
Force production mode, which prohibits the loader from emitting code (e.g. hot-reload related code) that is development-only.
69+
强制指定为生产环境,即禁止 loader 注入只在开发环境有效的代码 (例如 hot-reload 相关的代码)。

0 commit comments

Comments
 (0)