|
|
|
@ -1,14 +1,15 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="date-range">
|
|
|
|
|
<template v-for="(item, index) in opts" :key="index">
|
|
|
|
|
<el-button
|
|
|
|
|
v-for="(item, index) in opts"
|
|
|
|
|
:key="index"
|
|
|
|
|
v-if="item.value !== 'today' || !props.hiddenToday"
|
|
|
|
|
:class="{ active: active === item.value }"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="handleRange(item.value)"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value"
|
|
|
|
|
:clearable="false"
|
|
|
|
@ -21,6 +22,12 @@
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
hiddenToday: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
const opts = ref([
|
|
|
|
|
{
|
|
|
|
|
label: '今天',
|
|
|
|
|