Skip to content

Commit 887a205

Browse files
committed
[docs][zh] translated guide/README.md
1 parent 3905ea2 commit 887a205

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/zh/guide/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Getting Started
1+
# 如何起步
22

33
## Vue CLI
44

5-
If you are not interested in manually setting up webpack, it is recommended to scaffold a project with [Vue CLI](https://github.com/vuejs/vue-cli) instead. Projects created by Vue CLI are pre-configured with most of the common development needs working out of the box.
5+
如果你没有手动设置 webpack 的兴趣,我们推荐使用 [Vue CLI](https://github.com/vuejs/vue-cli) 直接创建一个项目的脚手架。通过 Vue CLI 创建的项目会预配置好绝大多数的开发需求,它们开箱即用。
66

7-
Follow this guide if the built-in configuration of Vue CLI does not suit your needs, or you'd rather create your own webpack config from scratch.
7+
如果 Vue CLI 提供的内建的配置没有满足你的需求,或者你乐于从零开始创建你自己的 webpack 配置,那么请跟随这份指南。
88

9-
## Manual Configuration
9+
## 手动配置
1010

11-
Vue Loader's configuration is a bit different form other loaders. In addition to a rule that applies `vue-loader` to any files with extension `.vue`, make sure to add Vue Loader's plugin to your webpack config:
11+
Vue Loader 的配置和其它的 loader 不太一样。除了通过一条规则将 `vue-loader` 应用到所有扩展名为 `.vue` 的文件上之外,请确认在你的 webpack 配置中添加 Vue Loader 的插件:
1212

1313
``` js
1414
// webpack.config.js
@@ -17,23 +17,23 @@ const { VueLoaderPlugin } = require('vue-loader')
1717
module.exports = {
1818
module: {
1919
rules: [
20-
// ... other rules
20+
// ... 其它规则
2121
{
2222
test: /\.vue$/,
2323
loader: 'vue-loader'
2424
}
2525
]
2626
},
2727
plugins: [
28-
// make sure to include the plugin!
28+
// 请确认引入这个插件!
2929
new VueLoaderPlugin()
3030
]
3131
}
3232
```
3333

34-
**The plugin is required!** It is responsible for cloning any other rules you have defined and applying them to the corresponding language blocks in `.vue` files. For example, if you have a rule matching `/\.js$/`, it will be applied to `<script>` blocks in `.vue` files.
34+
**这个插件是必须的!**它的职责是将你定义过的其它规则克隆并应用到 `.vue` 文件里相应语言的块。例如,如果你有一条匹配 `/\.js$` 的规则,那么它会应用到 `.vue` 文件里的 `<script>` 块。
3535

36-
A more complete example webpack config will look like this:
36+
一个更完整的 webpack 配置示例看起来像是如下的样子:
3737

3838
``` js
3939
// webpack.config.js
@@ -48,14 +48,14 @@ module.exports = {
4848
test: /\.vue$/,
4949
loader: 'vue-loader'
5050
},
51-
// this will apply to both plain .js files
52-
// AND <script> blocks in vue files
51+
// 它会应用到普通的 `.js` 文件
52+
// 以及 `.vue` 文件中的 `<script>` 块
5353
{
5454
test: /\.js$/,
5555
loader: 'babel-loader'
5656
},
57-
// this will apply to both plain .css files
58-
// AND <style> blocks in vue files
57+
// 它会应用到普通的 `.css` 文件
58+
// 以及 `.vue` 文件中的 `<style>` 块
5959
{
6060
test: /\.css$/,
6161
use: [
@@ -66,10 +66,10 @@ module.exports = {
6666
]
6767
},
6868
plugins: [
69-
// make sure to include the plugin for the magic
69+
// 请确认引入这个插件来实现这些魔力
7070
new VueLoaderPlugin()
7171
]
7272
}
7373
```
7474

75-
Also see [Options Reference](../options.md) for all available loader options.
75+
你也可以在[选项参考](../options.md)查阅所有可用的 loader 选项。

0 commit comments

Comments
 (0)