Skip to content

Commit 688b753

Browse files
committed
add missing trait impl
1 parent 1a89aa8 commit 688b753

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

packages/yew/src/html/conversion/into_prop_value.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub use implicit_clone::ImplicitClone;
77

88
use crate::callback::Callback;
99
use crate::html::{BaseComponent, ChildrenRenderer, Component, NodeRef, Scope};
10-
use crate::virtual_dom::{AttrValue, VChild, VList, VNode, VText};
10+
use crate::virtual_dom::{AttrValue, VChild, VList, VNode, VTag, VText};
1111

1212
impl ImplicitClone for NodeRef {}
1313
impl<Comp: Component> ImplicitClone for Scope<Comp> {}
@@ -153,6 +153,13 @@ impl IntoPropValue<VNode> for VText {
153153
}
154154
}
155155

156+
impl IntoPropValue<VNode> for VTag {
157+
#[inline]
158+
fn into_prop_value(self) -> VNode {
159+
VNode::VTag(Rc::new(self))
160+
}
161+
}
162+
156163
impl IntoPropValue<VNode> for () {
157164
#[inline]
158165
fn into_prop_value(self) -> VNode {
@@ -181,6 +188,13 @@ impl IntoPropValue<ChildrenRenderer<VNode>> for VText {
181188
}
182189
}
183190

191+
impl IntoPropValue<ChildrenRenderer<VNode>> for VTag {
192+
#[inline]
193+
fn into_prop_value(self) -> ChildrenRenderer<VNode> {
194+
ChildrenRenderer::new(vec![self.into()])
195+
}
196+
}
197+
184198
impl IntoPropValue<VList> for ChildrenRenderer<VNode> {
185199
#[inline]
186200
fn into_prop_value(self) -> VList {

0 commit comments

Comments
 (0)