<template>
  <el-date-picker
    ref="dateRangePickerRef"
    class="dateRangePicker"
    type="daterange"
    range-separator="至"
    start-placeholder="开始日期"
    end-placeholder="结束日期"
    value-format="YYYY-MM-DD"
    style="width: 220px"
    :popper-class="!props.isNeedTime ? '' : 'popperClass'"
    :teleported="true"
    v-bind="attrs"
  />
</template>
<script lang="ts" setup>
const props = defineProps({
  isNeedTime: {
    type: Boolean,
    default: false,
  },
})
const attrs = useAttrs()

const dateRangePickerRef = ref(null)

defineExpose({
  dateRangePickerRef,
})
</script>
<style lang="scss">
.popperClass .el-time-spinner__wrapper {
  width: 100% !important;
}
.popperClass .el-scrollbar:nth-of-type(2) {
  display: none !important;
}
</style>
