Skip to content

Commit 7ac1744

Browse files
committed
docs: update docs
1 parent ae1ff2c commit 7ac1744

File tree

1 file changed

+52
-12
lines changed

1 file changed

+52
-12
lines changed

README.md

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,43 @@
11
# coderwei-mini-vue3
22

3-
手写 vue3 核心源码,理解其原理 by myself
3+
手写 vue3 核心源码,理解其原理 by myself。
4+
5+
项目包含大量注释,在核心且具有跳跃性的点进行了注释,站着阅读者的视角,特别是关联其他模块某个方法or用到其他
6+
方法处理的结果,在该位置备注处理函数名及函数位置。保证每个阅读者都能跟着流程走完能够在心里对vue的整个流程有大致的认知。
7+
8+
无论是应付面试,还是希望通过有一个跷板进入vue3源码的世界,希望本项目都能够给到你帮助。项目还在持续更新中,力争完成vue的所有核心逻辑,进度在功能清单。如果有任何意见可以在issue中提出。
9+
10+
## 🕳️ 声明
11+
项目是通过阅读[vue3](https://github.com/vuejs/core/tree/main)源码,函数名、代码组织方式都与vue3官方保持一致,抽离一切非vue的核心逻辑。**如果大家在阅读过程中发现任何问题,欢迎在issue中提出,同时也欢迎大家提交PR。当然如果在阅读过程中有什么疑惑,也欢迎在issue中提出。**
12+
13+
## 🙌 使用方式
14+
15+
项目采取monorepo结构,打包入口和打包出口已配置好,甚至包含我进行测试的example和打包后的文件,可以直接去/packages/vue/example直接运行index.html文件
16+
17+
当然也可以选择自己打包
18+
~~~shell
19+
npm run build
20+
yarn build
21+
pnpm run build
22+
nr build
23+
~~~
24+
## 🗯️ 插件
25+
1. 这里推荐大家使用[ni](https://github.com/antfu/ni)
26+
27+
2. 在运行index.html文件的时候同样推荐大家安装vscode插件[Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
28+
429

5-
## 🙌 目的
6-
我想进大厂
730

831
## ✏ 相关参考
9-
[Vue3 核心原理代码解构](https://juejin.cn/column/7089244418703622175)
32+
1. [Vue3 核心原理代码解构](https://juejin.cn/column/7089244418703622175)
1033

11-
[崔学社](https://github.com/cuixiaorui/mini-vue)
34+
2. [崔学社](https://github.com/cuixiaorui/mini-vue)
1235

13-
[Vue.js 的设计与实现](https://item.jd.com/13611922.html)
36+
3. [Vue.js 的设计与实现](https://item.jd.com/13611922.html)
1437

1538
## 🛠 功能清单
1639

17-
reactivity 部分
40+
### reactivity 部分
1841
- [x] 实现 effect & reactive 依赖收集和依赖触发
1942
- [x] 实现 effect 返回 runner
2043
- [x] 实现 effect 的 scheduler 功能
@@ -34,7 +57,7 @@ reactivity 部分
3457
- [x] 实现 toRef 功能
3558
- [x] 实现 toRefs 功能
3659

37-
runtime-core 部分
60+
### runtime-core 部分
3861
- [x] 实现初始化 component 主流程
3962
- [x] 实现初始化 element 主流程 (通过递归 patch 拆箱操作,最终都会走向 mountElement 这一步)
4063
- [x] 实现组件代理对象 (instance.proxy 解决`render()`函数的 this 指向问题)
@@ -68,23 +91,40 @@ runtime-core 部分
6891
- [ ] 实现 Suspense 组件
6992
- [x] 实现 vue3的生命周期
7093

71-
runtime-dom
94+
### runtime-dom
7295
- [x] 实现浏览器端的渲染逻辑(插入节点、删除节点、更新节点等等)
7396
- [ ] 实现 Transition 组件
7497
- [ ] 实现 TransitionGroup 组件
7598

76-
compiler-core 部分
99+
### compiler-core 部分
77100
- [x] 实现 parse 模块
78101
- [x] 实现 transform 模块
79102
- [x] 实现 codegen 模块
80103
- [x] 定义统一的出口(定义 baseCompiler 函数)
81104

82-
兼容vue2部分
105+
### 兼容vue2部分
83106
- [ ] 兼容options api
84107
- [ ] 兼容vue2的生命周期 (beforeCreate、created等)
85108

109+
### 内置指令
110+
- [ ] v-text
111+
- [ ] v-html
112+
- [ ] v-show
113+
- [ ] v-if
114+
- [ ] v-else
115+
- [ ] v-else-if
116+
- [ ] v-for
117+
- [ ] v-on
118+
- [ ] v-bind
119+
- [ ] v-model
120+
- [ ] v-slot
121+
- [ ] v-pre
122+
- [ ] v-once
123+
- [ ] v-memo
124+
- [ ] v-cloak
125+
86126

87-
monorepo
127+
### monorepo
88128
- [x] 使用monorepo重构整个项目
89129
- [x] 使用vitest进行TDD测试
90130

0 commit comments

Comments
 (0)