![]() 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> <div class=""> <label v-if="withSpace"> </label> <b-form-group :invalid-feedback="form.error(field)" :state="form.state(field)" :description="fieldDescription"> <b-form-checkbox :id="idValue" v-model="form[field]" :value="1" :unchecked-value="0" @change="$emit('change',$event)"> {{ labelValue }} </b-form-checkbox> </b-form-group> </div> </template> <script> export default { name: "CoralsCheckbox", props: { form: { type: Object, required: true }, label: { type: [String, Boolean], default: '', required: false, }, field: { type: String, required: true, }, required: { type: Boolean, default: false }, withSpace: { type: Boolean, default: false } }, methods: {}, 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>