fix:修复日历视图设置高度不生效 (#3592)

This commit is contained in:
liukun 2025-07-17 23:28:21 -07:00 committed by GitHub
parent 93f5a61ae2
commit 06a3daee6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View File

@ -5,6 +5,7 @@
.@{calendar-view-prefix-cls} {
@apply w-full;
@apply h-auto;
@apply overflow-auto;
&__header {
@apply flex;

View File

@ -1,5 +1,9 @@
<template>
<div data-tag="tiny-calendar-view" class="w-full h-auto">
<div
data-tag="tiny-calendar-view"
class="w-full h-auto overflow-auto"
:style="{ 'height': height ? `${parseInt(height)}px` : 'auto' }"
>
<tiny-tooltip ref="tooltip" popper-class="absolute max-w-[theme(spacing.80)]" effect="light" placement="right">
<template #content>
<div class="p-2 max-h-[80vh] overflow-auto">
@ -171,7 +175,9 @@
>
<span
class="relative mr-2.5 text-base"
:class="[dateIsToday(date.value) || computedSelectDay(date) ? 'text-color-brand' : 'text-color-text-primary']"
:class="[
dateIsToday(date.value) || computedSelectDay(date) ? 'text-color-brand' : 'text-color-text-primary'
]"
>
<span>{{ date.value.split('-')[2] }}</span>
<span
@ -182,7 +188,11 @@
</span>
<span
class="text-sm"
:class="[dateIsToday(date.value) || computedSelectDay(date) ? 'text-color-brand' : 'text-color-text-placeholder']"
:class="[
dateIsToday(date.value) || computedSelectDay(date)
? 'text-color-brand'
: 'text-color-text-placeholder'
]"
>{{ dateIsToday(date.value) ? t('ui.datepicker.today') : t(`ui.calendarView.weekDays.${index}`) }}</span
>
</slot>

View File

@ -1,5 +1,5 @@
<template>
<div class="tiny-calendar-view" :style="{ 'height': typeof height === 'number' ? height + 'px' : height }">
<div class="tiny-calendar-view" :style="{ 'height': height ? `${parseInt(height)}px` : 'auto'}">
<div class="tiny-calendar-view__header">
<div>
<tiny-button v-if="showBackToday" @click="toToday">{{ t('ui.calendarView.backToday') }}</tiny-button>