Skip to content

Commit b041ea0

Browse files
committed
adjust content title
1 parent acedd1a commit b041ea0

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

slides.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,30 @@ by 夏影
2929
<div>
3030

3131
- 响应式系统
32+
+ 引子: 什么是响应式?
33+
+ 如何实现响应式数据?
3234
+ 副作用函数 effect
33-
+ reactive
34-
+ ref
35-
+ computed
36-
+ watch
35+
+ reactive 非原始值的响应式方案
36+
+ ref 原始值的响应式方案
37+
+ computed 的实现原理
38+
+ watch 的实现原理
39+
+ 响应式丢失问题
3740
+ 自动脱 ref
3841

39-
- 编译器
40-
+ 解析器 parser
41-
+ 转换器 transform
42-
+ 代码生成 generate
43-
4442
</div>
4543

4644
<div>
4745

48-
- Demo
49-
+ 计数器 Counter
46+
- 编译器
47+
+ 抽象语法树 AST
48+
+ 模板解析 parse
49+
+ 转换器 transform
50+
+ 代码生成 codegen
51+
+ 编译 compile
52+
53+
+ 挂载&更新
54+
55+
+ demo: 计数器 Counter
5056

5157
</div>
5258

@@ -63,7 +69,7 @@ transition: fade-out
6369
layout: default
6470
---
6571

66-
## 什么是响应式?
72+
## 引子: 什么是响应式?
6773

6874
考虑下面的代码:
6975

@@ -906,7 +912,7 @@ function watch(source, cb) {
906912

907913
---
908914

909-
## 非原始的值影响是方案: reactive
915+
## reactive: 非原始值的响应式方案
910916

911917
实际上之前对拦截器代码的封装,我们已经实现了 `reactive`
912918

@@ -971,7 +977,7 @@ obj.info.foo = 'aaa'
971977

972978
---
973979

974-
## 原始值的响应式方案: ref
980+
## ref: 原始值的响应式方案
975981

976982
对于原始数据类型,`number, string...`,JS 底层没有提供任何拦截的方式,JS 只能拦截对象类型的数据。
977983

@@ -1161,7 +1167,7 @@ export default {
11611167

11621168
我们知道,在 `setup()` 函数中会返回所有的响应式数据,那么是不是可以对返回值做一个代理,当访问 `ref` 数据时自动脱 ref 呢?
11631169

1164-
```vue
1170+
```js
11651171
<script>
11661172
export default {
11671173
setup() {
@@ -1601,7 +1607,7 @@ console.log(JSON.stringify(ast, null, 2))
16011607

16021608
---
16031609

1604-
## transform 转换器
1610+
## 转换器 transform
16051611

16061612
前面已经实现了 解析器(parser) —— 将模板字符串解析为 AST 语法树,接下来需要实现 transform 转换器,进一步处理模板 AST,为后期的代码生成做准备。
16071613

@@ -1801,7 +1807,7 @@ function processExpression(node) {
18011807

18021808
---
18031809

1804-
## codegen 代码生成
1810+
## 代码生成 codegen
18051811

18061812
上文实现了 `transform`,接下来进入 `compile` 最后的 `codegen` 阶段。
18071813

0 commit comments

Comments
 (0)