mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* time for more hygiene * update corresponding tests * while I'm at it * now let's fix the actual issue * fix the publish examples CI while I'm at it * resolve clippy warnings
30 lines
813 B
Rust
30 lines
813 B
Rust
#![no_implicit_prelude]
|
|
|
|
fn main() {
|
|
::yew::html! { <>{ "Hi" }</> };
|
|
::yew::html! { <>{ ::std::format!("Hello") }</> };
|
|
::yew::html! { <>{ ::std::string::ToString::to_string("Hello") }</> };
|
|
|
|
let msg = "Hello";
|
|
::yew::html! { <div>{ msg }</div> };
|
|
|
|
let subview = ::yew::html! { "subview!" };
|
|
::yew::html! { <div>{ subview }</div> };
|
|
|
|
let subview = || ::yew::html! { "subview!" };
|
|
::yew::html! { <div>{ subview() }</div> };
|
|
|
|
::yew::html! {
|
|
<ul>
|
|
{ for ::std::iter::Iterator::map(0..3, |num| { ::yew::html! { <span>{ num }</span> }}) }
|
|
</ul>
|
|
};
|
|
|
|
let item = |num| ::yew::html! { <li>{ ::std::format!("item {}!", num) }</li> };
|
|
::yew::html! {
|
|
<ul>
|
|
{ for ::std::iter::Iterator::map(0..3, item) }
|
|
</ul>
|
|
};
|
|
}
|