mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 03:27:52 +00:00
Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
67 lines
1.3 KiB
Vue
67 lines
1.3 KiB
Vue
<script>
|
|
export default {
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
placeholder: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
modelValue: {
|
|
type: [String, Number],
|
|
required: true,
|
|
},
|
|
error: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
},
|
|
computed: {
|
|
computedModel: {
|
|
get() {
|
|
return this.modelValue;
|
|
},
|
|
set(value) {
|
|
this.$emit('update:modelValue', value);
|
|
},
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<label class="block">
|
|
<div
|
|
v-if="label"
|
|
class="mb-2 text-xs font-medium"
|
|
:class="{
|
|
'text-black-800': !error,
|
|
'text-red-400': error,
|
|
}"
|
|
>
|
|
{{ label }}
|
|
</div>
|
|
<textarea
|
|
v-model="computedModel"
|
|
class="w-full px-3 py-2 leading-tight border rounded outline-none resize-none text-slate-700"
|
|
:class="{
|
|
'border-black-200 hover:border-black-300 focus:border-black-300':
|
|
!error,
|
|
'border-red-200 hover:border-red-300 focus:border-red-300': error,
|
|
}"
|
|
:placeholder="placeholder"
|
|
/>
|
|
<div v-if="error" class="mt-2 text-xs font-medium text-red-400">
|
|
{{ error }}
|
|
</div>
|
|
</label>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
textarea {
|
|
min-height: 8rem;
|
|
}
|
|
</style>
|