forked from craws/OpenAtlas-Discovery
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: modified all links to nuxt-i18n convention
- Loading branch information
1 parent
0e5df77
commit 28b61cb
Showing
8 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script setup lang="ts"> | ||
import { isUrl } from "@acdh-oeaw/lib"; | ||
const localePath = useLocalePath(); | ||
const props = defineProps<{ | ||
href: string; | ||
target?: "_blank"; | ||
}>(); | ||
const isExternalUrl = computed(() => { | ||
return isUrl(props.href); | ||
}); | ||
const href = computed(() => { | ||
if (isExternalUrl.value) return props.href; | ||
return localePath(props.href); | ||
}); | ||
const target = computed(() => { | ||
if (props.target != null) return props.target; | ||
if (isExternalUrl.value) return "_blank"; | ||
return undefined; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<NuxtLink :href="href" :target="target"> | ||
<slot /> | ||
</NuxtLink> | ||
</template> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters