diff --git a/src/client/theme-default/components/VPBadge.vue b/src/client/theme-default/components/VPBadge.vue index e2edb1b9..b9c14aa9 100644 --- a/src/client/theme-default/components/VPBadge.vue +++ b/src/client/theme-default/components/VPBadge.vue @@ -1,12 +1,15 @@ diff --git a/src/client/theme-default/components/VPButton.vue b/src/client/theme-default/components/VPButton.vue index d68673ae..3a284337 100644 --- a/src/client/theme-default/components/VPButton.vue +++ b/src/client/theme-default/components/VPButton.vue @@ -3,27 +3,24 @@ import { computed } from 'vue' import { normalizeLink } from '../support/utils' import { EXTERNAL_URL_RE } from '../../shared' -const props = defineProps<{ +interface Props { tag?: string size?: 'medium' | 'big' theme?: 'brand' | 'alt' | 'sponsor' text: string href?: string -}>() - -const classes = computed(() => [ - props.size ?? 'medium', - props.theme ?? 'brand' -]) +} +const props = withDefaults(defineProps(), { + size: 'medium', + theme: 'brand' +}) -const isExternal = computed(() => props.href && EXTERNAL_URL_RE.test(props.href)) +const isExternal = computed( + () => props.href && EXTERNAL_URL_RE.test(props.href) +) const component = computed(() => { - if (props.tag) { - return props.tag - } - - return props.href ? 'a' : 'button' + return props.tag || props.href ? 'a' : 'button' }) @@ -31,7 +28,7 @@ const component = computed(() => { () +} + +withDefaults(defineProps(), { + actionText: 'Become a sponsor' +})