-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from GuoXiCheng/dev-c
Dev c
- Loading branch information
Showing
4 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# 插值表达式 | ||
|
||
## 什么是插值表达式 | ||
|
||
插值表达式允许在 HTML 模版中使用双大括号 `{{}}` 包裹 Javascript 表达式,表达式的值会被直接插入到模版中。 | ||
|
||
## 插值表达式的使用 | ||
|
||
所有可以被求值的 Javascript 代码都可以用在插值表达式中,例如:文本内容、三元表达式、数字计算、函数调用等。 | ||
|
||
<<< @/../projects/vue-sandbox/src/components/TemplateSyntax/Interpolation.vue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 代理 | ||
|
||
## 什么是代理 | ||
|
||
代理是一个对象,它包装另一个对象并拦截对该对象的访问。代理可以拦截并重定向对目标对象的许多操作,包括属性查找、赋值、函数调用等。 | ||
|
||
::: warning | ||
代理与反射是 ES6 的新特性,在 ES6 之前没有类似代理的特性,因此转译器可能无法将代理转译为之前的 ES 代码。 | ||
::: | ||
|
||
## 创建代理 | ||
|
||
需要使用 `Proxy` 构造函数来创建代理对象。 | ||
|
||
`Proxy` 构造函数接受两个参数:目标对象 `target`和处理程序对象 `handler`。 | ||
|
||
<<< @/../projects/javascript-sandbox/src/proxy-and-reflect/proxy.ts#create-proxy | ||
|
||
## 创建可撤销代理 | ||
|
||
`Proxy.revocable` 方法可以创建一个可撤销的代理。 | ||
|
||
<<< @/../projects/javascript-sandbox/src/proxy-and-reflect/proxy.ts#revocable-proxy |