@nuvo-js/core 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,19 +87,22 @@ The `.dom` property provides access to the underlying native DOM element.
|
|
|
87
87
|
You can specify the native HTML element type using generics:
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
|
|
91
|
+
const button = new Element<HTMLButtonElement>({
|
|
92
|
+
tagName: 'button',
|
|
92
93
|
props: {
|
|
93
|
-
|
|
94
|
+
children: ['Click me']
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
|
|
97
|
-
const
|
|
98
|
-
tagName: '
|
|
98
|
+
const div = new Element<HTMLDivElement>({
|
|
99
|
+
tagName: 'div',
|
|
99
100
|
props: {
|
|
100
|
-
|
|
101
|
+
className: 'container',
|
|
102
|
+
children:[button.dom]
|
|
101
103
|
}
|
|
102
104
|
});
|
|
105
|
+
|
|
103
106
|
```
|
|
104
107
|
|
|
105
108
|
This provides better TypeScript support when working with native DOM elements.
|