Skip to content

Commit

Permalink
fix(theme-default): fallback external-link-icon when the plugin is di…
Browse files Browse the repository at this point in the history
…sabled (close #766) (#769)
  • Loading branch information
Mister-Hope committed Mar 31, 2022
1 parent 856be61 commit 3628fbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -12,6 +12,15 @@ export default defineClientAppEnhance(({ app, router }) => {
app.component('CodeGroup', CodeGroup)
app.component('CodeGroupItem', CodeGroupItem)

// compat with @vuepress/plugin-external-link-icon
app.component('AutoLinkExternalIcon', () => {
const ExternalLinkIcon = app.component('ExternalLinkIcon')
if (ExternalLinkIcon) {
return h(ExternalLinkIcon)
}
return null
})

// compat with @vuepress/plugin-docsearch and @vuepress/plugin-search
app.component('NavbarSearch', () => {
const SearchComponent =
Expand Down
Expand Up @@ -107,7 +107,7 @@ const isActive = computed(() => {
>
<slot name="before" />
{{ item.text }}
<ExternalLinkIcon v-if="isBlankTarget" />
<AutoLinkExternalIcon v-if="isBlankTarget" />
<slot name="after" />
</a>
</template>

0 comments on commit 3628fbf

Please sign in to comment.