fix show character limit not working (#386)
* fix show character limit not working * Improve code for char limit issue --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<div class="flex mb-1 input-help">
|
||||
<div
|
||||
v-if="shouldRender"
|
||||
class="flex mb-1 input-help"
|
||||
>
|
||||
<small
|
||||
:class="helpClasses"
|
||||
class="grow flex"
|
||||
@@ -19,8 +22,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({
|
||||
const slots = useSlots()
|
||||
const props = defineProps({
|
||||
helpClasses: { type: String, default: "text-gray-400 dark:text-gray-500" },
|
||||
help: { type: String, required: false },
|
||||
})
|
||||
|
||||
const shouldRender = computed(() => {
|
||||
return props.help || !!slots.help || !!slots['after-help']
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -18,10 +18,13 @@
|
||||
name="help"
|
||||
>
|
||||
<InputHelp
|
||||
v-if="help"
|
||||
:help="help"
|
||||
:help-classes="theme.default.help"
|
||||
/>
|
||||
>
|
||||
<template #after-help>
|
||||
<slot name="bottom_after_help" />
|
||||
</template>
|
||||
</InputHelp>
|
||||
</slot>
|
||||
<slot />
|
||||
|
||||
@@ -30,7 +33,6 @@
|
||||
name="help"
|
||||
>
|
||||
<InputHelp
|
||||
v-if="help"
|
||||
:help="help"
|
||||
:help-classes="theme.default.help"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user