Struct dioxus_router::components::LinkProps
source · pub struct LinkProps {
pub class: Option<String>,
pub active_class: Option<String>,
pub children: Element,
pub new_tab: bool,
pub onclick: Option<EventHandler<MouseEvent>>,
pub onmounted: Option<EventHandler<MountedEvent>>,
pub onclick_only: bool,
pub rel: Option<String>,
pub to: IntoRoutable,
/* private fields */
}Expand description
The properties for a Link.
Fields§
§class: Option<String>The class attribute for the a tag.
active_class: Option<String>A class to apply to the generate HTML anchor tag if the target route is active.
children: ElementThe children to render within the generated HTML anchor tag.
new_tab: boolWhen true, the target route will be opened in a new tab.
This does not change whether the Link is active or not.
onclick: Option<EventHandler<MouseEvent>>The onclick event handler.
onmounted: Option<EventHandler<MountedEvent>>The onmounted event handler. Fired when the element is mounted.
onclick_only: boolWhether the default behavior should be executed if an onclick handler is provided.
rel: Option<String>The rel attribute for the generated HTML anchor tag.
For external as, this defaults to noopener noreferrer.
to: IntoRoutableThe navigation target. Roughly equivalent to the href attribute of an HTML anchor tag.
Implementations§
source§impl LinkProps
impl LinkProps
sourcepub fn builder() -> LinkPropsBuilder<((), (), (), (), (), (), (), (), ())>
pub fn builder() -> LinkPropsBuilder<((), (), (), (), (), (), (), (), ())>
Create a builder for building LinkProps.
On the builder, call .class(...)(optional), .active_class(...)(optional), .children(...)(optional), .new_tab(...)(optional), .onclick(...)(optional), .onmounted(...)(optional), .onclick_only(...)(optional), .rel(...)(optional), .to(...) to set the values of the fields.
Finally, call .build() to create the instance of LinkProps.
Trait Implementations§
source§impl PartialEq for LinkProps
impl PartialEq for LinkProps
source§impl Properties for LinkPropswhere
Self: Clone,
impl Properties for LinkPropswhere
Self: Clone,
§type Builder = LinkPropsBuilder<((), (), (), (), (), (), (), (), ())>
type Builder = LinkPropsBuilder<((), (), (), (), (), (), (), (), ())>
source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
component_name: &'static str,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
component_name: &'static str,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for LinkProps
Auto Trait Implementations§
impl !Freeze for LinkProps
impl !RefUnwindSafe for LinkProps
impl !Send for LinkProps
impl !Sync for LinkProps
impl Unpin for LinkProps
impl !UnwindSafe for LinkProps
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)