fix(theme): fix external non-HTTP link redirection (#614)
This commit is contained in:
parent
7086bb0be9
commit
c21c9bdefa
@ -42,7 +42,7 @@ function linkTo(e: Event) {
|
||||
:is="component"
|
||||
class="vp-button"
|
||||
:class="[size, theme]"
|
||||
:href="link?.[0] === '#' ? link : withBase(link || '')"
|
||||
:href=" link ? link[0] === '#' || isExternal ? link : withBase(link) : undefined"
|
||||
:target="target ?? (isExternal ? '_blank' : undefined)"
|
||||
:rel="rel ?? (isExternal ? 'noreferrer' : undefined)"
|
||||
@click="linkTo($event)"
|
||||
|
||||
@ -29,7 +29,7 @@ function linkTo(e: Event) {
|
||||
<template>
|
||||
<Component
|
||||
:is="tag" class="vp-link no-icon" :class="{ link }"
|
||||
:href="link ? withBase(link) : undefined"
|
||||
:href="link ? isExternal ? link : withBase(link) : undefined"
|
||||
:target="target ?? (isExternal ? '_blank' : undefined)"
|
||||
:rel="rel ?? (isExternal ? 'noreferrer' : undefined)"
|
||||
@click="linkTo($event)"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user