https://github.com/fantasticit/vdom
A simple basic implement of virtual-dom algorithm
https://github.com/fantasticit/vdom
Last synced: 3 months ago
JSON representation
A simple basic implement of virtual-dom algorithm
- Host: GitHub
- URL: https://github.com/fantasticit/vdom
- Owner: fantasticit
- Created: 2018-12-14T05:24:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T15:15:22.000Z (over 2 years ago)
- Last Synced: 2025-04-04T08:51:23.369Z (6 months ago)
- Language: JavaScript
- Size: 1.44 MB
- Stars: 17
- Watchers: 0
- Forks: 2
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vdom
> A simple basic implement of virtual-dom algorithm
文章说明:[vdom 原理解析与简单实现](https://github.com/justemit/coding-note/issues/23)
实际应用:[qcharts](https://github.com/spritejs/q-charts)
## Usage
```javascript
let node1 = (
{[1, 2, 3].map(i => (
- {i}
))}
)let node2 = (
{[...Array(1000).keys()].map(i => (
- {i}
))}
)render(node1, '#app')
document.querySelector('.btn').onclick = () => {
const patches = diff(node1, node2)
patch('#app', patches)
}
```
## LICENSE
MIT