diff --git a/components/content/Alert.vue b/components/content/Alert.vue index fcd54f2b..5a01e762 100644 --- a/components/content/Alert.vue +++ b/components/content/Alert.vue @@ -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'), }); } diff --git a/components/content/ProseA.vue b/components/content/ProseA.vue index e19dbdc1..91db94b8 100644 --- a/components/content/ProseA.vue +++ b/components/content/ProseA.vue @@ -2,6 +2,7 @@ @@ -21,5 +22,10 @@ defineProps({ default: undefined, required: false, }, + external: { + type: Boolean, + default: undefined, + required: false, + }, }); diff --git a/components/layout/SearchDialog.vue b/components/layout/SearchDialog.vue index 506c37bd..1e3ddca6 100644 --- a/components/layout/SearchDialog.vue +++ b/components/layout/SearchDialog.vue @@ -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; } } diff --git a/package.json b/package.json index 8d3f7522..3b58e41b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shadcn-docs-nuxt", "type": "module", - "version": "0.5.3", + "version": "0.5.4", "author": "Tony Zhang ", "license": "MIT", "homepage": "https://shadcn-docs.nuxt.dev/",