diff --git a/resources/js/components/forms/TextAreaInput.vue b/resources/js/components/forms/TextAreaInput.vue index 1b8b4d5..abbf177 100644 --- a/resources/js/components/forms/TextAreaInput.vue +++ b/resources/js/components/forms/TextAreaInput.vue @@ -11,10 +11,17 @@ class="resize-y" :name="name" :style="inputStyle" :placeholder="placeholder" + :maxlength="maxCharLimit" /> - - {{ help }} - +
+ + {{ help }} + + + + {{ charCount }}/{{ maxCharLimit }} + +
@@ -24,6 +31,16 @@ import inputMixin from '~/mixins/forms/input.js' export default { name: 'TextAreaInput', - mixins: [inputMixin] + mixins: [inputMixin], + + props: { + maxCharLimit: { type: Number, required: false, default: null }, + showCharLimit: { type: Boolean, required: false, default: false }, + }, + computed: { + charCount() { + return (this.compVal) ? this.compVal.length : 0 + } + } }