Socket
Socket
Sign inDemoInstall

sme-vdom

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sme-vdom

a simple virtual dom lib


Version published
Maintainers
1
Install size
24.8 kB
Created

Readme

Source

sme-vdom

a simple virtual dom lib

start 👾

  • install

npm i sme-vdom

  • usage
import VirtualDom from 'sme-vdom'

const newDom = {
  tag: 'div',
  children: [
    {
      tag: 'h1',
      className: 'header',
      style: 'color: #7d7df1; padding-left: 16px;',
      text: 'Hii ~'
    },
    {
      tag: 'section',
      className: 'content',
      style: 'color: #606c76;  padding-left: 16px;',
      text: 'Hallo, vdom content ~~',
      children: [
        {
          tag: 'p',
          className: 'p1',
          text: 'too young'
        },
        {
          tag: 'p',
          className: 'p2',
          text: 'some time nativeeee'
        }
      ]
    },
    {
      tag: 'footer',
      style: 'margin: 20px 16px;',
      text: '@power by hwen <hwenleung@gmail.com>'
    },
    {
      // tag 可缺省,默认为 div 标签
      style: 'color: #606c76;  padding-left: 16px;',
      text: '== (○´・д・)ノ 暴力膜不可取 =='
    }
  ]
}

const tree = new VirtualDom(newDom)
const $dom = tree.render()
const $app = document.querySelector('#app')
$app.replaceWith($dom)

live demo 🤓

demooooo

develop 🤕

npm i
npm run dev

open http://localhost:8080/

  • build with webpack
npm run build
  • build with rollup
npm run build:rollup

refrence 🐱‍

inspired by simple-virtual-dom

Contributors

Thanks goes to these wonderful people (emoji key):


hwen

🤔 💻 🎨 📖 💡

Keywords

FAQs

Last updated on 03 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc