feat(templating): only assign standard DOM props
This commit is contained in:
parent
6844ffe9f2
commit
669fee1d49
3 changed files with 4 additions and 4 deletions
|
@ -8,9 +8,9 @@ export class Counter extends WebComponent {
|
|||
return html`
|
||||
<button
|
||||
class="hey"
|
||||
ID="btn"
|
||||
id="btn"
|
||||
onClick=${() => ++this.props.count}
|
||||
style="background-color: black; color: white;"
|
||||
style="background-color: green; color: white;"
|
||||
about="Elephant"
|
||||
>
|
||||
<span>${this.props.count}</span>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "web-component-base",
|
||||
"version": "2.0.0-beta.16",
|
||||
"version": "2.0.0-beta.17",
|
||||
"description": "A zero-dependency, ~600 Bytes (minified & gzipped), JS base class for creating reactive custom elements easily",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
|
|
|
@ -20,7 +20,7 @@ export function createElement(tree) {
|
|||
case 'class': domProp = 'className'; break;
|
||||
case 'for': domProp = 'htmlFor'; break;
|
||||
}
|
||||
el[domProp] = tree.props[prop]
|
||||
if (domProp in el) el[domProp] = tree.props[prop]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue