✨(component): datePicker组件 新增layui-laydate-current样式,用于modelValue为空时高亮当前时间
This commit is contained in:
parent
3caf99a721
commit
2bc0517d64
@ -16,7 +16,10 @@
|
||||
<li
|
||||
v-for="item of MONTH_NAME"
|
||||
:key="item"
|
||||
:class="{ 'layui-this': MONTH_NAME.indexOf(item) === Month }"
|
||||
:class="{
|
||||
'layui-this': MONTH_NAME.indexOf(item) === Month,
|
||||
'layui-laydate-current':Month===''&&parseInt(item)-1===dayjs().month()
|
||||
}"
|
||||
@click="handleMonthClick(item)"
|
||||
>
|
||||
{{ item.slice(0, 3) }}
|
||||
|
@ -36,6 +36,7 @@
|
||||
'laydate-range-hover': ifHasRangeHoverClass(
|
||||
getUnix(item, 'left')
|
||||
),
|
||||
'layui-laydate-current':(startTime.unix === -1 || endTime.unix === -1)&&getUnix(item, 'left')===dayjs().startOf('month').valueOf()
|
||||
}"
|
||||
@click="handleMonthClick(getUnix(item, 'left'))"
|
||||
@mouseenter="monthItemMouseEnter($event, item)"
|
||||
@ -80,6 +81,7 @@
|
||||
'laydate-range-hover': ifHasRangeHoverClass(
|
||||
getUnix(item, 'right')
|
||||
),
|
||||
'layui-laydate-current':(startTime.unix === -1 || endTime.unix === -1)&&getUnix(item, 'right')===dayjs().startOf('month').valueOf()
|
||||
}"
|
||||
@click="handleMonthClick(getUnix(item, 'right'))"
|
||||
@mouseenter="monthItemMouseEnter($event, item)"
|
||||
|
@ -18,7 +18,10 @@
|
||||
<li
|
||||
v-for="item of yearList"
|
||||
:key="item"
|
||||
:class="{ 'layui-this': Year === item }"
|
||||
:class="{
|
||||
'layui-this': Year === item,
|
||||
'layui-laydate-current':!Year&&item===dayjs().year()
|
||||
}"
|
||||
@click="handleYearClick(item)"
|
||||
>
|
||||
{{ item }}
|
||||
|
@ -27,6 +27,7 @@
|
||||
(item.value == startDate || item.value == endDate)),
|
||||
'laydate-range-hover': ifHasRangeHoverClass(item),
|
||||
'layui-disabled': item.type !== 'current' && datePicker.range,
|
||||
'layui-laydate-current':modelValue===-1&&item.value===dayjs().startOf('day').valueOf()
|
||||
}"
|
||||
@click="handleDayClick(item)"
|
||||
@mouseenter="dayItemMouseEnter($event, item)"
|
||||
@ -48,6 +49,7 @@ export default {
|
||||
import { useI18n } from "../../../../language";
|
||||
import { computed, inject } from "vue";
|
||||
import { provideType } from "../../interface";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export interface DateContentProps {
|
||||
dateList: any;
|
||||
|
@ -577,3 +577,6 @@ html #layuicss-laydate {
|
||||
width: 340px;
|
||||
}
|
||||
}
|
||||
.layui-laydate-current{
|
||||
background-color: var(--global-neutral-color-3);
|
||||
}
|
Loading…
Reference in New Issue
Block a user