Skip to content

Commit 9b28914

Browse files
authored
Merge pull request #327 from dnum-mi/feat/slotDsfrInputRequiredStory
feat: ✨ Ajoute un exemple de champ obligatoire avec slot dan…
2 parents b157c2e + 5433a78 commit 9b28914

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/components/DsfrInput/DsfrInput.stories.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,25 @@ export const ChampObligatoire = (args) => ({
158158
}
159159
},
160160
template: `
161+
<component :is="'style'">
162+
.required {
163+
color: red;
164+
}
165+
</component>
161166
<DsfrInput
162167
:model-value="modelValue"
163168
:label="label"
164169
:label-visible="labelVisible"
165170
:placeholder="placeholder"
166171
:disabled="disabled"
167172
:required="true"
168-
/>
173+
>
174+
<template v-slot:required-tip>
175+
<span class="required"
176+
>&nbsp;*
177+
</span>
178+
</template>
179+
</DsfrInput>
169180
`,
170181
mounted () {
171182
document.body.parentElement.setAttribute('data-fr-theme', this.dark ? 'dark' : 'light')

0 commit comments

Comments
 (0)