Skip to content

FreeCodeCamp-Chengdu/virtual-dom

 
 

Repository files navigation

virtual-dom

A virtual DOM implementation。

Run

安装依赖:

npm install

运行Demo:

make start

打开浏览器输入 http://localhost:3000

Usage

import { path } from 'virtual-dom';

const vnode1 = (
  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
  </ul>
)

const vnode2 = (
  <ul>
    <li>4</li>
    <li>5</li>
    <li>6</li>
  </ul>
)

const container = document.getElementById('demo');
path(undefined, vnode1, container);
window.setTimeout(() => patch(vnode1, vnode2), 1000);

About

A simple virtual DOM implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.5%
  • Makefile 6.9%
  • CSS 3.4%
  • HTML 3.2%