File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
## 在 Vue 中使用自定义元素 {#using-custom-elements-in-vue}
8
8
9
- Vue [ 在 Custom Elements Everywhere 测试中取得了 100% 的分数] ( https://custom-elements-everywhere.com/libraries/vue/results/results.html ) 。在 Vue 应用中使用自定义元素基本上上与使用原生 HTML 元素的效果相同,但需要留意以下几点:
9
+ Vue [ 在 Custom Elements Everywhere 测试中取得了 100% 的分数] ( https://custom-elements-everywhere.com/libraries/vue/results/results.html ) 。在 Vue 应用中使用自定义元素基本上与使用原生 HTML 元素的效果相同,但需要留意以下几点:
10
10
11
11
### 跳过组件解析 {#skipping-component-resolution}
12
12
@@ -132,7 +132,7 @@ document.body.appendChild(
132
132
133
133
- 基础类型的属性值 (` string ` ,` boolean ` 或 ` number ` ) 会被反射为 attribute。
134
134
135
- - Vue 也会在它们被设置为 attribute 时自动转换以 ` Boolean ` 或 ` Number ` 类型声明的 props 到所期望的类型。当它们被设为 attributes 时 (永远是字符串) 。比如下面这样的 props 声明:
135
+ - 当它们被设为 attribute 时 (永远是字符串),Vue 也会自动将以 ` Boolean ` 或 ` Number ` 类型声明的 prop 转换为所期望的类型 。比如下面这样的 props 声明:
136
136
137
137
``` js
138
138
props: {
@@ -230,7 +230,7 @@ export function register() {
230
230
231
231
自定义元素和 Vue 组件之间确实存在一定程度的功能重叠:它们都允许我们定义具有数据传递、事件发射和生命周期管理的可重用组件。然而,Web Components 的 API 相对来说是更底层的和更基础的。要构建一个实际的应用程序,我们需要相当多平台没有涵盖的附加功能:
232
232
233
- - 一个声明式的、高效的模板系统。
233
+ - 一个声明式的、高效的模板系统;
234
234
235
235
- 一个响应式状态管理系统,促进跨组件逻辑提取和重用;
236
236
You can’t perform that action at this time.
0 commit comments