Created
May 28, 2022 00:35
-
-
Save lega911/125c7baad88b94f3bede1a2d2c364dae to your computer and use it in GitHub Desktop.
Blocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import Button from './button.xht'; | |
// able to create a component/block by JS | |
function Custom($option) { | |
return document.createTextNode('Custom JS-component'); | |
} | |
</script> | |
<!-- declare block "Local" and accept block Inner --> | |
{#Local Inner} | |
<h1>some local fragment</h1> | |
<Inner /> | |
{/Local} | |
<!-- call Local and pass Button as inner --> | |
<Local Inner=Button /> | |
<!-- call Custom --> | |
<Custom /> | |
<!-- call Child --> | |
<Child Body=Local> <!-- pass block Local as Body --> | |
{#Header}title{/Header} <!-- pass Header --> | |
</Child> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- accept blocks Body, Header --> | |
<script Body Header> | |
import Field from './field.xht'; | |
</script> | |
<!-- insert block Header --> | |
<Header /> | |
<!-- insert block Body and pass Field as Inner --> | |
<Body Inner=Field /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment