You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**asyncInitialization**: Accepts a function that returns a Promise.
168
169
-**loaderAttribute**: Defines the attribute used to mark loader spinner (default is `data-web-component-loader`).
169
170
-**hideSlotContentUntilMounted**: Hide the content of named slots until the component is fully mounted.
171
+
-**nonce**: Content Security Policy (CSP) nonce for your web component.
170
172
171
173
### asyncInitialization
172
174
@@ -175,7 +177,7 @@ The `asyncInitialization` option accepts a function that returns a Promise. The
175
177
#### Example Usage
176
178
177
179
```javascript
178
-
constasyncPromise= () => {
180
+
constasyncPromise= () => {
179
181
returnnewPromise((resolve) => {
180
182
setTimeout(() => {
181
183
resolve()
@@ -192,7 +194,7 @@ createWebComponent({
192
194
h,
193
195
createApp,
194
196
getCurrentInstance,
195
-
asyncInitialization: asyncPromise, // default is Promise.resolve()
197
+
asyncInitialization: asyncPromise, // default is Promise.resolve()
196
198
loaderAttribute:'data-web-component-loader',
197
199
hideSlotContentUntilMounted:true, // default is false
198
200
});
@@ -270,6 +272,10 @@ createWebComponent({
270
272
271
273
The `cssFrameworkStyles` option imports the CSS of your CSS framework or any other global CSS styles your application needs. By setting `replaceRootWithHostInCssFramework` to `true`, any `:root` selectors in your styles will be replaced with `:host`, ensuring correct scoping within the web component.
272
274
275
+
### nonce
276
+
277
+
The `nonce` option is used to set a Content Security Policy (CSP) nonce for your web component. This is useful when your application uses inline scripts or styles, as it allows you to specify a unique nonce value that can be used to whitelist the inline content.
278
+
273
279
### 4. Build Your Application
274
280
275
281
Tested bundlers to build the web-component application.
0 commit comments