feat: showLabel
This commit is contained in:
@@ -4,9 +4,10 @@ import type { ButtonProps } from "@nuxt/ui";
|
||||
|
||||
type AcfLinkButtonProps = & Omit<ButtonProps, "to" | "target" | "href"> & {
|
||||
link?: AcfLinkFragment;
|
||||
showLabel?: boolean;
|
||||
};
|
||||
|
||||
const { link, ...buttonProps } = defineProps<AcfLinkButtonProps>();
|
||||
const { link, showLabel, ...buttonProps } = defineProps<AcfLinkButtonProps>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -18,6 +19,6 @@ const { link, ...buttonProps } = defineProps<AcfLinkButtonProps>();
|
||||
:external="link.target === '_blank'"
|
||||
:rel="link.target === '_blank' ? 'noopener noreferrer' : undefined"
|
||||
>
|
||||
<slot>{{ link.title }}</slot>
|
||||
<slot>{{ showLabel ? link.title : "" }}</slot>
|
||||
</UButton>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user