diff --git a/src/leptos/table.rs b/src/leptos/table.rs index 2289f32..c11babd 100644 --- a/src/leptos/table.rs +++ b/src/leptos/table.rs @@ -37,7 +37,7 @@ pub fn Table( #[prop(into)] data: MaybeSignal, /// A list of closures defining the column heading. - column_heading: Vec Fragment>>, + column_heading: Vec) -> Fragment>>, /// A list of closures that return the contents of each column. columns: Vec Fragment>>, ) -> impl IntoView @@ -48,8 +48,19 @@ where // Used for inserting custom sort algorithms via leptos-meta provide_meta_context(); - let heading_items = - move || column_heading.iter().map(|head| head()).collect::>(); + let heading_items = column_heading + .into_iter() + .map(|head| { + move || { + let ref_th = create_node_ref::(); + view! { + + { head(ref_th) } + + } + } + }) + .collect::>(); let ref_table = create_node_ref::(); let init_table = move || {