A date picker enhanced component for element-plus
up to now
You can refer to DatePicker | Element Plus
*
: extra support
halfyear
quarteryear
yearrange
halfyearrange
quarteryearrange
wantEnd
By default, when a value is modified, the value passed is the starting value of the range,and you can get the end value by props of 'wantEnd'.
allowSame
By default, the start and end values of the range can be the same, and you can set the value to false
to not allow the same value.
<script setup lang="ts">
import DatePickerEnhanced from 'datepicker-enhanced'
import 'datepicker-enhanced/dist/style.css'
import { ElDatePicker } from 'element-plus'
const extraType = ['halfyear', 'quarteryear', 'yearrange', 'halfyearrange', 'quarteryearrange']
const type = ref('halfyear')
</script>
<template>
<template v-if="extraType.includes(type)">
<DatePickerEnhanced v-model="value" :type="type" />
</template>
<template v-else>
<ElDatePicker v-model="value" :type="type" />
</template>
</template>