Improve docs
This commit is contained in:
parent
2d1cf0ce54
commit
d898f92cb9
|
@ -378,6 +378,12 @@ Show or hides an element based on whether an expression evaluates to `true` or `
|
|||
<div data-show="$foo"></div>
|
||||
```
|
||||
|
||||
To prevent flickering of the element before Datastar has processed the DOM, you can add a `display: none` style to the element to hide it initially.
|
||||
|
||||
```html
|
||||
<div data-show="$foo" style="display: none"></div>
|
||||
```
|
||||
|
||||
### `data-view-transition`
|
||||
|
||||
Sets the `view-transition-name` style attribute explicitly.
|
||||
|
|
|
@ -16,7 +16,7 @@ If, for some reason, you cannot escape unsafe user input, you should ignore it u
|
|||
|
||||
## Content Security Policy
|
||||
|
||||
When using a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) (CSP), `unsafe-eval` must be allowed for scripts, since Datastar evaluates expressions inline.
|
||||
When using a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) (CSP), `unsafe-eval` must be allowed for scripts, since Datastar evaluates expressions using an [IIFE](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) (Immediately Invoked Function Expression).
|
||||
|
||||
```html
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
|
|
Loading…
Reference in New Issue