fix: normalize link in VPButton (#919)

pull/924/head
Divyansh Singh 2 years ago committed by GitHub
parent 3e0c5e406d
commit bed68f1341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue' import { computed } from 'vue'
import { withBase } from 'vitepress' import { normalizeLink } from '../support/utils'
const props = defineProps<{ const props = defineProps<{
tag?: string tag?: string
@ -31,7 +31,7 @@ const component = computed(() => {
:is="component" :is="component"
class="VPButton" class="VPButton"
:class="classes" :class="classes"
:href="href ? withBase(href) : undefined" :href="href ? normalizeLink(href) : undefined"
:target="isExternal ? '_blank' : undefined" :target="isExternal ? '_blank' : undefined"
:rel="isExternal ? 'noopener noreferrer' : undefined" :rel="isExternal ? 'noopener noreferrer' : undefined"
> >

Loading…
Cancel
Save