Simplify syntax of InputHelp

This commit is contained in:
Julien Nahum 2024-05-27 11:27:46 +02:00
parent 53f2e99ec3
commit ca159804f9
3 changed files with 26 additions and 30 deletions

View File

@ -7,7 +7,7 @@
:class="helpClasses" :class="helpClasses"
class="grow flex" class="grow flex"
> >
<slot name="help"> <slot>
<span <span
v-if="help" v-if="help"
class="field-help" class="field-help"
@ -29,6 +29,6 @@ const props = defineProps({
}) })
const shouldRender = computed(() => { const shouldRender = computed(() => {
return props.help || !!slots.help || !!slots['after-help'] return props.help || !!slots.default || !!slots['after-help']
}) })
</script> </script>

View File

@ -13,7 +13,6 @@
> >
<template #help> <template #help>
<InputHelp> <InputHelp>
<template #help>
<span> <span>
Receive a discord message on each form submission. Receive a discord message on each form submission.
<a <a
@ -24,7 +23,6 @@
</a> </a>
to learn how to get a discord webhook url. to learn how to get a discord webhook url.
</span> </span>
</template>
</InputHelp> </InputHelp>
</template> </template>
</text-input> </text-input>

View File

@ -13,7 +13,6 @@
> >
<template #help> <template #help>
<InputHelp> <InputHelp>
<template #help>
<span> <span>
Receive slack message on each form submission. Receive slack message on each form submission.
<a <a
@ -24,7 +23,6 @@
</a> </a>
to learn how to get a slack webhook url to learn how to get a slack webhook url
</span> </span>
</template>
</InputHelp> </InputHelp>
</template> </template>
</text-input> </text-input>