diff --git a/examples/js-framework-benchmark/src/lib.rs b/examples/js-framework-benchmark/src/lib.rs index 2985ef040..db7ded721 100644 --- a/examples/js-framework-benchmark/src/lib.rs +++ b/examples/js-framework-benchmark/src/lib.rs @@ -162,22 +162,24 @@ pub fn App() -> impl IntoView { - - - - - }) + template! { + < tr class : danger = { move || is_selected.selected(Some(row_id)) } + > < td class = "col-md-1" > { row_id.to_string() } < td + class = "col-md-4" >< a on : click = move | _ | set_selected + .set(Some(row_id)) > { move || label.get() } < td + class = "col-md-1" >< a on : click = move | _ | remove(row_id) >< + span class = "glyphicon glyphicon-remove" aria - hidden = "true" > < td class = "col-md-6" /> + } } /> +
{row_id.to_string()}{move || label.get()} -
diff --git a/leptos_macro/src/lib.rs b/leptos_macro/src/lib.rs index 8abc3667e..325d1f33f 100644 --- a/leptos_macro/src/lib.rs +++ b/leptos_macro/src/lib.rs @@ -266,6 +266,21 @@ mod slot; #[proc_macro] #[cfg_attr(feature = "tracing", tracing::instrument(level = "trace", skip_all))] pub fn view(tokens: TokenStream) -> TokenStream { + view_macro_impl(tokens, false) +} + +/// The `template` macro behaves like [`view`], except that it wraps the entire tree in a +/// [`ViewTemplate`](leptos::prelude::ViewTemplate). This optimizes creation speed by rendering +/// most of the view into a `