Skip to content

Commit

Permalink
fix(prose): add external prop to ProseA
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <[email protected]>
  • Loading branch information
ZTL-UwU committed Sep 10, 2024
1 parent a49e0cd commit 6caf467
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions components/content/Alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ const typeTwClass = {
danger: 'border-red-600 text-red-600 [&>svg]:text-red-600',
};
function alertClick() {
async function alertClick() {
if (props.to) {
if (props.target) {
navigateTo(props.to, {
await navigateTo(props.to, {
external: props.external ?? props.to.startsWith('http'),
open: { target: props.target },
});
} else {
navigateTo(props.to, {
await navigateTo(props.to, {
external: props.external ?? props.to.startsWith('http'),
});
}
Expand Down
6 changes: 6 additions & 0 deletions components/content/ProseA.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<NuxtLink
:href="href"
:target="target"
:external="external"
class="font-semibold underline underline-offset-4"
>
<slot />
Expand All @@ -21,5 +22,10 @@ defineProps({
default: undefined,
required: false,
},
external: {
type: Boolean,
default: undefined,
required: false,
},
});
</script>
4 changes: 2 additions & 2 deletions components/layout/SearchDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ watch(activeSelect, (value) => {
document.querySelector(`[id="${value}"]`)?.scrollIntoView({ block: 'nearest' });
});
function handleEnter() {
async function handleEnter() {
if (searchResult.value[activeSelect.value]?.id) {
navigateTo(searchResult.value[activeSelect.value].id);
await navigateTo(searchResult.value[activeSelect.value].id);
open.value = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "shadcn-docs-nuxt",
"type": "module",
"version": "0.5.3",
"version": "0.5.4",
"author": "Tony Zhang <[email protected]>",
"license": "MIT",
"homepage": "https://shadcn-docs.nuxt.dev/",
Expand Down

0 comments on commit 6caf467

Please sign in to comment.