fix formatting
This commit is contained in:
1 parent
afb258b658
commit
bc557906fe
3 files changed
+9
-12
No files matched your search
@@ -15,7 +15,7 @@ use serde::{de::DeserializeOwned, Serialize};
|
||||
/// let state1 = use_state(cx, || server_cached(|| {
|
||||
/// 1234
|
||||
/// }));
|
||||
///
|
||||
///
|
||||
/// todo!()
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@@ -148,7 +148,10 @@ impl_event! {
|
||||
|
||||
/// ondoubleclick
|
||||
#[inline]
|
||||
pub fn ondoubleclick<'a, E: crate::EventReturn<T>, T>(_cx: &'a ::dioxus_core::ScopeState, mut _f: impl FnMut(::dioxus_core::Event<MouseData>) -> E + 'a) -> ::dioxus_core::Attribute<'a> {
|
||||
pub fn ondoubleclick<'a, E: crate::EventReturn<T>, T>(
|
||||
_cx: &'a ::dioxus_core::ScopeState,
|
||||
mut _f: impl FnMut(::dioxus_core::Event<MouseData>) -> E + 'a,
|
||||
) -> ::dioxus_core::Attribute<'a> {
|
||||
::dioxus_core::Attribute::new(
|
||||
"ondblclick",
|
||||
_cx.listener(move |e: ::dioxus_core::Event<MouseData>| {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
|
||||
#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
|
||||
|
||||
use dioxus_html::{map_html_element_to_rsx, map_html_attribute_to_rsx};
|
||||
use convert_case::{Case, Casing};
|
||||
use dioxus_html::{map_html_attribute_to_rsx, map_html_element_to_rsx};
|
||||
use dioxus_rsx::{
|
||||
BodyNode, CallBody, Component, Element, ElementAttr, ElementAttrNamed, ElementName, IfmtInput,
|
||||
};
|
||||
@@ -33,10 +33,7 @@ pub fn rsx_node_from_html(node: &Node) -> Option<BodyNode> {
|
||||
ElementName::Custom(LitStr::new(&el.name, Span::call_site()))
|
||||
} else {
|
||||
// otherwise, it might be an element that isn't supported yet
|
||||
ElementName::Ident(Ident::new(
|
||||
&el.name.to_case(Case::Snake),
|
||||
Span::call_site(),
|
||||
))
|
||||
ElementName::Ident(Ident::new(&el.name.to_case(Case::Snake), Span::call_site()))
|
||||
}
|
||||
};
|
||||
|
||||
@@ -51,10 +48,7 @@ pub fn rsx_node_from_html(node: &Node) -> Option<BodyNode> {
|
||||
} else {
|
||||
Ident::new(name, Span::call_site())
|
||||
};
|
||||
ElementAttr::AttrText {
|
||||
value,
|
||||
name: ident,
|
||||
}
|
||||
ElementAttr::AttrText { value, name: ident }
|
||||
} else {
|
||||
// If we don't recognize the attribute, we assume it's a custom attribute
|
||||
ElementAttr::CustomAttrText {
|
||||
@@ -65,7 +59,7 @@ pub fn rsx_node_from_html(node: &Node) -> Option<BodyNode> {
|
||||
|
||||
ElementAttrNamed {
|
||||
el_name: el_name.clone(),
|
||||
attr
|
||||
attr,
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
Reference in new issue
Block a user