2
0
mirror of https://github.com/esiur/iui.git synced 2025-06-27 17:33:12 +00:00
This commit is contained in:
2021-10-29 17:09:15 +03:00
parent 1e8ae99d39
commit b3479dbdbd
35 changed files with 857 additions and 166 deletions

View File

@ -0,0 +1,51 @@
# Declarative Rendering
# Text nodes
Text nodes are enclosed with `${...}`
<i-codepreview>
${ navigator.userAgent }
</i-codepreview>
# Fields
starts with `:`
<i-codepreview>
<input :value="navigator.userAgent">
</i-codepreview>
# Attributes
starts with `::`
<i-codepreview>
<input ::placeholder="navigator.appName">
</i-codepreview>
# Asynchronous
*Promise*
Promises are automatically resolved.
<i-codepreview>
${fetch("md/hello.md")}
</i-codepreview>
*Await*
To use await in text nodes **async** attribute must be added to the parent element
<i-codepreview>
<div async>
${await (await fetch("md/hello.md")).text()}
</div>
</i-codepreview>
In attributes, the attribute name must be preceded with **async:**
<i-codepreview>
<input async:value = "await (await fetch('md/hello.md')).text()">
</i-codepreview>
Attributes are similar they must start with *async::*
<i-codepreview>
<input async::placeholder = "await (await fetch('md/hello.md')).text()">
</i-codepreview>