Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

Commit e37e0df

Browse files
authored
docs: Update custom-elements-interop.md (#723)
1 parent 629076a commit e37e0df

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/guide/migration/custom-elements-interop.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ badges:
88
## 概览
99

1010
- **非兼容**:检测并确定哪些标签应该被视为自定义元素的过程,现在会在模板编译期间执行,且应该通过编译器选项而不是运行时配置来配置。
11-
- **非兼容**:特殊的 `is` prop 的使用被严格限制在保留的 `<component>` 标签中。
11+
- **非兼容**:特殊的 `is` attribute 的使用被严格限制在保留的 `<component>` 标签中。
1212
- **新增**:为了支持 2.x 在原生元素上使用 `is` 的用例来处理原生 HTML 解析限制,我们用 `vue:` 前缀来解析一个 Vue 组件。
1313

1414
## 自主定制元素
@@ -69,21 +69,21 @@ Vue.config.ignoredElements = ['plastic-button']
6969
<button is="plastic-button">点击我!</button>
7070
```
7171

72-
在原生 attribute 于浏览器中普遍可用之前,Vue 对 `is` 这个特殊 prop 的使用就已经在模拟其行为。但是,在 2.x 中,它将被解释为渲染一个名为 `plastic-button` 的 Vue 组件,这将阻碍上面所提到的自定义内置元素的原生用法。
72+
在原生 attribute 于浏览器中普遍可用之前,Vue 对 `is` 这个特殊 attribute 的使用就已经在模拟其行为。但是,在 2.x 中,它将被解释为渲染一个名为 `plastic-button` 的 Vue 组件,这将阻碍上面所提到的自定义内置元素的原生用法。
7373

74-
在 3.0 中,我们将 Vue 对 `is` prop 的特殊处理限制在了 `<component>` 标签中。
74+
在 3.0 中,我们将 Vue 对 `is` attribute 的特殊处理限制在了 `<component>` 标签中。
7575

7676
- 在保留的 `<component>` 标签上使用时,它的行为将与 2.x 中完全相同;
77-
- 在普通组件上使用时,它的行为将类似于普通 prop
77+
- 在普通组件上使用时,它的行为将类似于普通 attribute
7878

7979
```html
8080
<foo is="bar" />
8181
```
8282

8383
- 2.x 的行为:渲染 `bar` 组件。
84-
- 3.x 的行为:渲染 `foo` 组件,并将 `is` prop 传递给它。
84+
- 3.x 的行为:渲染 `foo` 组件,并将 `is` attribute 传递给它。
8585

86-
- 在普通元素上使用时,它将作为 `is` prop 传递给 `createElement` 调用,并作为原生 attribute 渲染。这支持了自定义内置元素的用法。
86+
- 在普通元素上使用时,它将作为 `is` attribute 传递给 `createElement` 调用,并作为原生 attribute 渲染。这支持了自定义内置元素的用法。
8787

8888
```html
8989
<button is="plastic-button">点击我!</button>
@@ -105,7 +105,7 @@ Vue.config.ignoredElements = ['plastic-button']
105105

106106
### 2.x 语法
107107

108-
在 Vue 2 中,我们建议在原生标签上使用 `is` prop 来绕过这些限制:
108+
在 Vue 2 中,我们建议在原生标签上使用 `is` attribute 来绕过这些限制:
109109

110110
```html
111111
<table>

0 commit comments

Comments
 (0)