mirror of
https://github.com/alexohneander/alexohneander-astro.git
synced 2025-07-01 07:51:52 +00:00
feat: add target blank as default to LinkButton
This commit is contained in:
parent
261a6f548b
commit
31a309b95c
@ -81,6 +81,7 @@ const { activeNav } = Astro.props;
|
|||||||
}`}
|
}`}
|
||||||
ariaLabel="search"
|
ariaLabel="search"
|
||||||
title="Search"
|
title="Search"
|
||||||
|
newTarget={false}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
@ -5,9 +5,10 @@ export interface Props {
|
|||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
newTarget?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { href, className, ariaLabel, title, disabled = false } = Astro.props;
|
const { href, className, ariaLabel, title, disabled = false, newTarget = true } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<a
|
<a
|
||||||
@ -17,6 +18,7 @@ const { href, className, ariaLabel, title, disabled = false } = Astro.props;
|
|||||||
aria-label={ariaLabel}
|
aria-label={ariaLabel}
|
||||||
title={title}
|
title={title}
|
||||||
aria-disabled={disabled}
|
aria-disabled={disabled}
|
||||||
|
target={ newTarget ? "_blank" : "_self"}
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user