Skip to content

Commit 4c9762e

Browse files
authored
Merge pull request #981 from MaitreManuel/dsfr-callout-default-slot-vs-text
fix: 🐛 DsfrCallout description critere 8.9 RGAA 4.1.2 NC
2 parents 8d542de + 2064d39 commit 4c9762e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/components/DsfrCallout/DsfrCallout.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { VIconProps } from '../VIcon/VIcon.vue'
33

44
export type DsfrCalloutProps = {
55
title?: string
6-
content: string
6+
content?: string
77
titleTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
88
button?: DsfrButtonProps
99
icon?: string | VIconProps

src/components/DsfrCallout/DsfrCallout.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ const iconProps = computed(() => dsfrIcon.value ? undefined : typeof props.icon
3636
{{ title }}
3737
</component>
3838

39-
<p class="fr-callout__text">
39+
<p
40+
v-if="content"
41+
class="fr-callout__text"
42+
>
4043
{{ content }}
4144
</p>
4245

@@ -46,7 +49,13 @@ const iconProps = computed(() => dsfrIcon.value ? undefined : typeof props.icon
4649
/>
4750

4851
<!-- @slot Slot par défaut pour le contenu de la mise en avant. Sera dans `<div class="fr-callout">` -->
49-
<slot />
52+
<div
53+
v-if="$slots.default && !content"
54+
class="fr-callout__text"
55+
>
56+
<slot />
57+
</div>
58+
<slot v-else />
5059
</div>
5160
</template>
5261

0 commit comments

Comments
 (0)