mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
parent
246bc5960b
commit
97f67fa77d
@ -146,13 +146,11 @@ impl ComponentProps {
|
||||
)}
|
||||
});
|
||||
|
||||
let set_children = if let Some(children) = children_renderer {
|
||||
let set_children = children_renderer.map(|children| {
|
||||
Some(quote_spanned! {props_ty.span()=>
|
||||
.children(#children)
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
});
|
||||
|
||||
quote_spanned! {props_ty.span()=>
|
||||
<#props_ty as ::yew::html::Properties>::builder()
|
||||
@ -163,13 +161,11 @@ impl ComponentProps {
|
||||
}
|
||||
Self::With(with_props) => {
|
||||
let ident = Ident::new("__yew_props", props_ty.span());
|
||||
let set_children = if let Some(children) = children_renderer {
|
||||
let set_children = children_renderer.map(|children| {
|
||||
Some(quote_spanned! {props_ty.span()=>
|
||||
#ident.children = #children;
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
});
|
||||
|
||||
let expr = &with_props.expr;
|
||||
quote! {
|
||||
|
||||
@ -65,12 +65,12 @@ impl Parse for PropValue {
|
||||
}
|
||||
|
||||
impl From<PropValue> for Prop {
|
||||
fn from(prop_value: PropValue) -> Prop {
|
||||
fn from(val: PropValue) -> Prop {
|
||||
let PropValue {
|
||||
label,
|
||||
colon_token,
|
||||
value,
|
||||
} = prop_value;
|
||||
} = val;
|
||||
Prop {
|
||||
label,
|
||||
question_mark: None,
|
||||
|
||||
@ -55,7 +55,7 @@ fn test_get_query_params() {
|
||||
bar: 69,
|
||||
};
|
||||
|
||||
yew_router::push_route_with_query(Routes::Home, query.clone()).unwrap();
|
||||
yew_router::push_route_with_query(Routes::Home, query).unwrap();
|
||||
|
||||
let params: HashMap<String, String> = parse_query().unwrap();
|
||||
|
||||
|
||||
@ -90,8 +90,8 @@ impl<S: Store> Agent for StoreWrapper<S> {
|
||||
|
||||
StoreWrapper {
|
||||
handlers,
|
||||
state,
|
||||
link,
|
||||
state,
|
||||
self_dispatcher,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user