wip: move examples around
This commit is contained in:
1 parent
d298b626d3
commit
1e6e5e611b
86 files changed
+160
-216
No files matched your search
+11
-9
@@ -46,7 +46,8 @@ static App: FC<()> = |(cx, props)| {
|
||||
});
|
||||
|
||||
cx.render(rsx! {
|
||||
div { style: { width: "400px", height: "400px", position: "relative", background: "yellow" }
|
||||
div {
|
||||
width: "400px", height: "400px", position: "relative", background: "yellow"
|
||||
button { "reset", onclick: move |_| {} }
|
||||
Horsey { pos: *p1, "horsey 1" }
|
||||
Horsey { pos: *p2, "horsey 2" }
|
||||
@@ -54,18 +55,19 @@ static App: FC<()> = |(cx, props)| {
|
||||
})
|
||||
};
|
||||
|
||||
#[derive(PartialEq, Props)]
|
||||
struct HorseyProps {
|
||||
#[derive(Props)]
|
||||
struct HorseyProps<'a> {
|
||||
pos: i32,
|
||||
children: ScopeChildren<'a>,
|
||||
}
|
||||
|
||||
static Horsey: FC<HorseyProps> = |(cx, props)| {
|
||||
fn Horsey<'a>((cx, props): Scope<'a, HorseyProps<'a>>) -> Element {
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
button { "pause" }
|
||||
div {
|
||||
{cx.children()}
|
||||
button { "pause" }
|
||||
div {
|
||||
{&props.children}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user