forked from coracle/flotilla
Migrate more stuff
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
<script lang="ts">
|
||||
import {goto} from "$app/navigation"
|
||||
|
||||
export let href
|
||||
export let external = false
|
||||
export let replaceState = false
|
||||
interface Props {
|
||||
href: string
|
||||
external: boolean
|
||||
replaceState: boolean
|
||||
}
|
||||
|
||||
let {href, external = false, replaceState = false, ...restProps} = $props()
|
||||
|
||||
const go = (e: Event) => {
|
||||
if (!external) {
|
||||
@@ -16,9 +20,9 @@
|
||||
|
||||
<a
|
||||
{href}
|
||||
{...$$props}
|
||||
{...restProps}
|
||||
on:click|stopPropagation={go}
|
||||
class="cursor-pointer {$$props.class}"
|
||||
class="cursor-pointer {restProps.class}"
|
||||
rel={external ? "noopener noreferer" : ""}
|
||||
target={external ? "_blank" : ""}>
|
||||
<slot />
|
||||
|
||||
Reference in New Issue
Block a user