thaw/demo/src/pages/menu/mod.rs

38 lines
1 KiB
Rust
Raw Normal View History

2023-09-21 21:57:34 +08:00
use crate::components::{Demo, DemoCode};
2023-06-13 12:43:15 +08:00
use leptos::*;
use melt_ui::*;
2023-10-04 00:11:38 +08:00
use prisms::highlight_str;
2023-06-13 12:43:15 +08:00
#[component]
2023-08-29 09:11:22 +08:00
pub fn MenuPage() -> impl IntoView {
2023-10-11 21:25:11 +08:00
let value = create_rw_signal(String::from("o"));
2023-08-29 09:11:22 +08:00
view! {
2023-09-21 21:57:34 +08:00
<div style="width: 896px; margin: 0 auto;">
<h1>"Menu"</h1>
<Demo>
2023-10-11 21:25:11 +08:00
<Menu value>
2023-09-21 21:57:34 +08:00
<MenuItem key="a" label="and"/>
<MenuItem key="o" label="or"/>
</Menu>
2023-10-08 09:28:13 +08:00
<DemoCode
slot
html=highlight_str!(
r#"
2023-10-11 21:25:11 +08:00
let value = create_rw_signal(String::from("o"));
2023-10-04 00:11:38 +08:00
2023-10-11 21:25:11 +08:00
<Menu value>
2023-10-04 00:11:38 +08:00
<MenuItem key="a" label="and"/>
<MenuItem key="o" label="or"/>
</Menu>
2023-10-08 09:28:13 +08:00
"#,
"rust"
)
>
2023-10-04 00:11:38 +08:00
""
2023-09-21 21:57:34 +08:00
</DemoCode>
</Demo>
</div>
2023-06-13 12:43:15 +08:00
}
}