feat: add target to Link
Some checks failed
Deploy demo / deploy (push) Has been cancelled

This commit is contained in:
Adam 2024-09-11 22:44:51 -04:00
parent 09ef9f8630
commit e9d1630473
2 changed files with 5 additions and 0 deletions

View file

@ -77,3 +77,4 @@ view! {
| disabled | `MaybeSignal<bool>` | `false` | Whether the link is disabled. |
| disabled_focusable | `MaybeSignal<bool>` | `false` | When set, allows the link to be focusable even when it has been disabled. |
| children | `Children` | | |
| target | `MaybeSignal<String>` | | Specifies where to open the linked document. |

View file

@ -16,6 +16,9 @@ pub fn Link(
#[prop(optional, into)]
disabled_focusable: MaybeSignal<bool>,
children: Children,
/// Specifies where to open the linked document.
#[prop(optional, into)]
target: MaybeSignal<String>,
) -> impl IntoView {
mount_style("link", include_str!("./link.css"));
@ -46,6 +49,7 @@ pub fn Link(
href=href
tabindex=tabindex
aria-disabled=move || link_disabled.get().then_some("true")
target=target
>
{children()}
</a>