mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 23:04:24 +00:00
Tweak handling of component children
This commit is contained in:
parent
335c040702
commit
9d43eb5503
1 changed files with 8 additions and 6 deletions
|
@ -407,7 +407,7 @@ fn component_to_tokens(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn component_child(cx: &Ident, node: &Node, mode: Mode) -> TokenStream {
|
fn component_child(cx: &Ident, node: &Node, mode: Mode) -> TokenStream {
|
||||||
let node = match node {
|
match node {
|
||||||
Node::Block(node) => {
|
Node::Block(node) => {
|
||||||
let span = node.value.span();
|
let span = node.value.span();
|
||||||
let value = node.value.as_ref();
|
let value = node.value.as_ref();
|
||||||
|
@ -419,13 +419,15 @@ fn component_child(cx: &Ident, node: &Node, mode: Mode) -> TokenStream {
|
||||||
let span = node.value.span();
|
let span = node.value.span();
|
||||||
let value = node.value.as_ref();
|
let value = node.value.as_ref();
|
||||||
quote_spanned! {
|
quote_spanned! {
|
||||||
span => text(#value)
|
span => text(#value).into_view(#cx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
let node = node_to_tokens(cx, node, mode);
|
||||||
|
quote! {
|
||||||
|
#node.into_view(#cx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => node_to_tokens(cx, node, mode),
|
|
||||||
};
|
|
||||||
quote! {
|
|
||||||
node.into_view(#cx)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue