用Vue3写项目也有一段时间了。 在业余时间也贡献过一点点Vue3 组件库开源项目: pro-components
最近忽然想尝试着看看源码,最好能亲自动手敲一遍,说搞就搞:mini-vue3
注释什么的都尽量写的详细些,尽可能的说明每句话的意思。记录自己学习的过程。 如果后续能再补些脑图就更好了,算是先埋个坑吧。
目前进度如下:
reactivity
- reactivity
- 嵌套 reactive
- readonly
- effect
- effect.scheduler
- effect.stop
- computed 的实现
- watch 的实现
- watchEffect 的实现
- watch、watchEffect回调函数 onCleanup的实现
- track 依赖收集
- trigger 触发依赖
- isReactive
- isReadonly
- isProxy
- toRaw
- ref 的实现
- effectScope 的实现
runtime-core
- h函数实现
- renderer函数实现
- 初次挂载element实现
- patchElement
- diff
runtime-dom
- dom操作实现
- event
- class
- style
- props