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
28 lines
671 B
Rust
28 lines
671 B
Rust
#![no_implicit_prelude]
|
|
|
|
fn main() {
|
|
let dyn_tag = || ::std::string::ToString::to_string("test");
|
|
let mut next_extra_tag = {
|
|
let mut it = ::std::iter::IntoIterator::into_iter(::std::vec!["a", "b"]);
|
|
move || ::std::option::Option::unwrap(::std::iter::Iterator::next(&mut it))
|
|
};
|
|
|
|
::yew::html! {
|
|
<@{ dyn_tag() }>
|
|
<@{ next_extra_tag() } class="extra-a"/>
|
|
<@{ next_extra_tag() } class="extra-b"/>
|
|
</@>
|
|
};
|
|
|
|
::yew::html! {
|
|
<@{
|
|
let tag = dyn_tag();
|
|
if tag == "test" {
|
|
"div"
|
|
} else {
|
|
"a"
|
|
}
|
|
}/>
|
|
};
|
|
}
|