dna-element

1.0.3 • Public • Published

⚕️ DnaElement

A tiny back store for apps using webcomponents (Polymer).

installation

$ yarn add dna-element

usage

import { DnaElement, html } from 'dna-element'
 
class MyApp extends DnaElement {
 
    constructor() {
        super();
 
        this.setData('appMainColor', 'red');
    }
 
    static get template() {
        return html`
            <h1 style="color:{{data.appMainColor}}">My App</h1>
        `
    }
}
 
...
 
class DashBoard extends DnaElement {
    static get template() {
        return html`
            <p>Current App Color is : {{data.appMainColor}}</p>
        `;
    }
}
 
...

run the demo

$ git clone https://github.com/vdegenne/dna-element.git
cd dna-element
cd yarn run serve

and access http://localhost:8000/demo (change the port if polymer couldn't use 8000 by default)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    0
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i dna-element

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

4.2 kB

Total Files

7

Last publish

Collaborators

  • vdegenne