![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ts.corals.io/frontend/components/CoralsForm/ |
<template> <b-form-group :invalid-feedback="form.error(field)" :label="labelValue" :label-for="idValue" :label-class="required?'required-field':''" :description="fieldDescription" :state="form.state(field)"> <b-form-textarea v-if="hasValueAttr" v-bind="$attrs" :id="idValue" @input="$emit('input',$event)" :state="form.state(field)"> </b-form-textarea> <b-form-textarea v-else v-bind="$attrs" :id="idValue" @input="$emit('input',$event)" :state="form.state(field)" v-model.trim="form[field]"> </b-form-textarea> </b-form-group> </template> <script> export default { name: "CoralsTextarea", props: { form: { type: Object, required: true }, label: { type: [String, Boolean], default: '', required: false, }, field: { type: String, required: true, }, required: { type: Boolean, default: false } }, computed: { hasValueAttr() { return this.$attrs.value !== undefined; }, labelValue() { if (this.label === false) { return ''; } if (this.label) { return this.label; } let label = this.field.replace('_', ' '); return label.charAt(0).toUpperCase() + label.slice(1); }, idValue() { if (this.$attrs.id) { return this.$attrs.id; } return this.field; }, fieldDescription() { return this.$attrs.description || ''; } } } </script> <style scoped> </style>