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)

/dna-element/

    Package Sidebar

    Install

    npm i dna-element

    Weekly Downloads

    3

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    4.2 kB

    Total Files

    7

    Last publish

    Collaborators

    • vdegenne