0.7.3 • Published 3 years ago

veljs v0.7.3

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

VirtualElement

A Javascript library for building reliable, high-performance web applications.

Features

Documentation

Basic example (v1 rendering style)

class MyElement extends VirtualElement {
  constructor() {
    super();
    this.v2 = false
  }

  render() {
    return this.html`<div class="my-element"><h1>MyElement</h1></div>`
  }
}  

Basic example (v2 rendering style)

This example requires babel-plugin-veljs-jsx for transpiling jsx syntax to template literals

class MyElement extends VirtualElement {
  render() {
    return <div class="my-element"><h1>MyElement</h1></div>
  }
}  

Basic example with reactive properties (v2 rendering style)

Each virtual element might have a set of reactive properties. Changing value will trigger a redraw.

<html>
  <head>
  </head>
  <body>
    <div id="app"></div>
  </body>
</html>
// index.js
import { VirtualElement, render, Component } from 'veljs';

class MyElement extends VirtualElement {
  static get properties() {
    return {
      cnt: { type: Number, default: 0}
    }
  }

  render() {
    return (
      <div class="my-element">
        <h1>MyElement, cnt={this.cnt}</h1>
        <button onClick={() => this.cnt += 1}>Click me</button>
      </div>
    )
  }
}  

render(document.getElementById('app'), Component(MyElement)())

TBD

0.7.2

3 years ago

0.7.3

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago