Commit f4084ab4 authored by Jinjiang's avatar Jinjiang

[docs][zh] translated all new parts

parent 5e7a3d0c
......@@ -172,11 +172,11 @@ npm install -D babel-core babel-loader
Babel 的配置可以通过 `.babelrc``babel-loader` 选项来完成。
### Excluding node_modules
### 排除 node_modules
It is common to have `exclude: /node_modules/` for JS transpilation rules (e.g. `babel-loader`) that apply to `.js` files. Due to the inference change of v15, if you import a Vue SFC inside `node_modules`, its `<script>` part will be excluded from transpilation as well.
`exclude: /node_modules/` 在运用于 `.js` 文件的 JS 转译规则 (例如 `babel-loader`) 中是蛮常见的。鉴于 v15 中的推导变化,如果你导入一个 `node_modules` 内的 Vue 单文件组件,它的 `<script>` 部分在转译时将会被排除在外。
In order to ensure JS transpilation is applied to Vue SFCs in `node_modules`, you need to whitelist them by using an exclude function instead:
为了确保 JS 的转译应用到 `node_modules` 的 Vue 单文件组件,你需要通过替换使用一个排除函数将其设为白名单:
``` js
{
......
......@@ -57,11 +57,11 @@ module.exports = {
v15 也允许为 loader 使用非序列化的选项,这种选项在之前的版本中是无法使用的。
### Importing SFCs from Dependencies
### 从依赖中导入单文件组件
It is common to have `exclude: /node_modules/` for JS transpilation rules (e.g. `babel-loader`) that apply to `.js` files. Due to the inference change of v15, if you import a Vue SFC inside `node_modules`, its `<script>` part will be excluded from transpilation as well.
`exclude: /node_modules/` 在运用于 `.js` 文件的 JS 转译规则 (例如 `babel-loader`) 中是蛮常见的。鉴于 v15 中的推导变化,如果你导入一个 `node_modules` 内的 Vue 单文件组件,它的 `<script>` 部分在转译时将会被排除在外。
In order to ensure JS transpilation is applied to Vue SFCs in `node_modules`, you need to whitelist them by using an exclude function instead:
为了确保 JS 的转译应用到 `node_modules` 的 Vue 单文件组件,你需要通过替换使用一个排除函数将其设为白名单:
``` js
{
......
......@@ -73,4 +73,4 @@ sidebar: auto
- 类型:`boolean`
- 默认值:`false`
Compiled the component for usage inside Shadow DOM. In this mode, the styles of the component will be injected into `this.$root.$options.shadowRoot` instead of the document head.
编译用于 Shadow DOM 内部的组件。在该模式下,组件的样式会被注入到 `this.$root.$options.shadowRoot`,而不是文档的 head 部分。
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment