Skip to content

Commit

Permalink
feat: add patch excalidraw
Browse files Browse the repository at this point in the history
  • Loading branch information
w2xi committed Jan 29, 2024
1 parent 7ffb221 commit 48f0508
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
Binary file added public/mount.excalidraw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/patch.excalidraw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/template-to-render.excalidraw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/vnode-to-dom.excalidraw.png
Binary file not shown.
8 changes: 6 additions & 2 deletions slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -2205,9 +2205,9 @@ transition: fade-out

前面我们实现了 **响应式系统****编译**(丐中丐版),已经有能力将模板编译成渲染函数了,现在我们将它们整合起来,同时为了能将代码跑起来,我们还需要稍微简单实现下 **挂载**

过程如下图所示:
如下图所示:

<img src="/public/vnode-to-dom.excalidraw.png" />
<img src="/public/mount.excalidraw.png" />

---

Expand Down Expand Up @@ -2409,6 +2409,10 @@ createApp({

接下来我们来简单优化下,实现一个简单的 `patch` 函数,用来对比新旧节点,只更新需要更新的部分。

如下图所示:

<img src="/public/patch.excalidraw.png" />

---

## Counter 计数器
Expand Down

0 comments on commit 48f0508

Please sign in to comment.