![]() 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-datepicker v-bind="$attrs" @input="$emit('input',$event)" :id="idValue" :state="form.state(field)" v-model="form[field]"/> </b-form-group> </template> <script> export default { name: "CoralsDatepicker", props: { form: { type: Object, required: true }, label: { type: [String, Boolean], default: '', required: false, }, type: { type: String, default: 'text', }, field: { type: String, required: true, }, required: { type: Boolean, default: false } }, computed: { 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>