feat: use standard event prop behavior
- call .toLowerCase() on attribute props
This commit is contained in:
parent
7bf37d75db
commit
b4f3b98ee4
3 changed files with 3 additions and 3 deletions
|
@ -6,7 +6,7 @@ export class Counter extends WebComponent {
|
|||
};
|
||||
get template() {
|
||||
return html`
|
||||
<button onclick=${() => ++this.props.count} style="background-color: black; color: white;">
|
||||
<button onClick=${() => ++this.props.count} style="background-color: black; color: white;">
|
||||
<span>${this.props.count}</span>
|
||||
</button>
|
||||
`;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "web-component-base",
|
||||
"version": "2.0.0-beta.13",
|
||||
"version": "2.0.0-beta.14",
|
||||
"description": "A zero-dependency, ~600 Bytes (minified & gzipped), JS base class for creating reactive custom elements easily",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
|
|
|
@ -8,7 +8,7 @@ export function createElement(tree) {
|
|||
} else {
|
||||
const el = document.createElement(tree.type);
|
||||
if (tree.props)
|
||||
Object.keys(tree.props).forEach(prop => el[prop] = tree.props[prop])
|
||||
Object.keys(tree.props).forEach(prop => el[prop.toLowerCase()] = tree.props[prop])
|
||||
tree.children?.forEach((child) => {
|
||||
const childEl = createElement(child);
|
||||
if (childEl) {
|
||||
|
|
Loading…
Reference in a new issue