Browse Source

Add styling support to component

master
Nicolas Petton 1 year ago
parent
commit
191e5d5d1d
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/component.js

+ 5
- 1
src/component.js View File

@ -15,7 +15,7 @@ const attrsToProps = (component, attrs) => {
});
};
const component = (name, renderer) => {
const component = (name, renderer, style) => {
class Component extends HTMLElement {
constructor(props) {
super();
@ -52,6 +52,10 @@ const component = (name, renderer) => {
let html = new HtmlCanvas(this.shadowRoot);
html.render(this._renderable);
if (style) {
html.style(style);
}
});
}


Loading…
Cancel
Save