<template>
  <div class="form-item-box" :style="{ width: width }">
    <el-date-picker style="width:100%" v-model="modelValue" type="date" v-bind="$attrs" @change="onInput" :placeholder="placeholder" value-format="YYYY-MM-DD"/>
  </div>
</template>

<script setup>
import { COMPONENT_WIDTH } from "@/constant";
import { ref, defineProps, defineEmits, defineExpose } from "vue";
const props = defineProps({
  //获取组件传值
  placeholder: {
    default: "请填写",
    type: String
  },
  modelValue: {
    default: "",
    type: String
  },
  width: {
    default: COMPONENT_WIDTH,
    type: String
  },
  
});

const emits = defineEmits(["update:modelValue"]);
const onInput = (e) => {
  emits("update:modelValue", e);
};
</script>

