```typescript= const A = component$(() => { return $(() => { <B> <div> <button onclick/> </div> </B> }) }) ``` ```typescript= const B = component$(() => { return $(() => ( <span><Slot></Slot></span> )); }) ``` ```htmlembedded= <A> <B> <button/> </B> </A> ``` ```htmlembedded= <a q:host> <b q:host> <span> <q:slot> <div> <button/> </div> </q:slot> </span> </b> </a> ``` ```typescript= while(isSlot(element)) { element = element.closest('q:slot,[q:host]'); } ``` --- ```typescript= const Parent = component$(() => { return $(() => ( <span>before<Slot>default</Slot>after</span> )); }) ``` ```typescript= const App = component$(() => { return $(() => ( <Parent>{text}</Parent> )); }) ``` ```htmlembedded= <parent> <span q:slot> before <!--q:slot-->text<!--/q:slot--> after </span> </parent> ``` --- ```typescript= const App = component$(() => { return $(() => ( <SomeAPI whileLoading={<span>loading...</span>} onTimeout> <Parent>{text}</Parent> </SomeAPI> )); }) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up