<template>
  <div v-if="['date', 'datetime'].includes(formConfig.currentItem.componentCode)">
    <a-form-item label="禁用当日之前日期:" class="form-row" v-if="formConfig.currentItem.formItemDate">
      <a-checkbox v-model:checked="formConfig.currentItem.formItemDate.disableCurrentBefore" class="form-row-top"></a-checkbox>
    </a-form-item>
  </div>
</template>

<script setup name="DateAttr">
import { inject, onMounted } from 'vue';

const formConfig = inject('formConfig');

onMounted(() => {
  if (!formConfig.value.currentItem.formItemDate) {
    formConfig.value.currentItem.formItemDate = {
      disableCurrentBefore: false
    }
  }
})
</script>

<style></style>
