feat(stages): 添加性能测试和虚拟DOM实现阶段

添加stage04-perf用于真实DOM操作性能对比,包含三个不同的更新策略:
- innerHTML全量更新
- createElement全量重建
- 精确单节点更新

添加stage04用于模拟异步接口数据获取后的渲染演示

添加stage05实现虚拟DOM基础功能,提供VNode对象描述DOM树结构和递
归渲染函数
This commit is contained in:
zzy
2026-05-02 12:36:53 +08:00
parent fc87cf4622
commit 845789cd60
7 changed files with 483 additions and 0 deletions

43
stage04-perf/index.css Normal file
View File

@@ -0,0 +1,43 @@
.list-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px;
border-bottom: 1px solid #eee;
}
.avatar {
width: 40px;
height: 40px;
background: #ddd;
border-radius: 50%;
text-align: center;
line-height: 40px;
}
.content h4 {
margin: 0;
font-size: 16px;
}
.content p {
margin: 4px 0;
font-size: 14px;
color: #555;
}
.tag {
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
}
.active {
background: #d4edda;
color: #155724;
}
.inactive {
background: #f8d7da;
color: #721c24;
}