thunderous 0.2.2 → 0.2.3
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 +14 -4
- package/package.json +1 -1
package/README.md
CHANGED
@@ -91,10 +91,20 @@ You can always define the internals the same as you usually would, and if for so
|
|
91
91
|
|
92
92
|
<!-- prettier-ignore-start -->
|
93
93
|
```ts
|
94
|
-
const MyElement = customElement((
|
95
|
-
|
96
|
-
|
97
|
-
|
94
|
+
const MyElement = customElement((params) => {
|
95
|
+
const {
|
96
|
+
internals,
|
97
|
+
elementRef,
|
98
|
+
root,
|
99
|
+
connectedCallback,
|
100
|
+
} = params;
|
101
|
+
|
102
|
+
internals.setFormValue('hello world');
|
103
|
+
connectedCallback(() => {
|
104
|
+
const childLink = elementRef.querySelector('a[href]'); // light DOM
|
105
|
+
const innerLink = root.querySelector('a[href]'); // shadow DOM
|
106
|
+
/* ... */
|
107
|
+
});
|
98
108
|
/* ... */
|
99
109
|
}, { formAssociated: true });
|
100
110
|
```
|