优化字体大小
This commit is contained in:
@@ -115,10 +115,11 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, nextTick, onMounted, ref, watch, type PropType } from "vue";
|
import { computed, nextTick, onMounted, ref, watch, type PropType } from "vue";
|
||||||
import { ctx, dayUts, first, isDark, isEmpty, isHarmony, parsePt, useRefs } from "@/cool";
|
import { ctx, dayUts, first, isDark, isHarmony, parsePt, useRefs } from "@/cool";
|
||||||
import CalendarPicker from "./picker.uvue";
|
import CalendarPicker from "./picker.uvue";
|
||||||
import { $t, t } from "@/locale";
|
import { $t, t } from "@/locale";
|
||||||
import type { ClCalendarDateConfig, ClCalendarMode } from "../../types";
|
import type { ClCalendarDateConfig, ClCalendarMode } from "../../types";
|
||||||
|
import { useSize } from "../../hooks";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "cl-calendar"
|
name: "cl-calendar"
|
||||||
@@ -202,6 +203,9 @@ type PassThrough = {
|
|||||||
// 解析透传样式配置
|
// 解析透传样式配置
|
||||||
const pt = computed(() => parsePt<PassThrough>(props.pt));
|
const pt = computed(() => parsePt<PassThrough>(props.pt));
|
||||||
|
|
||||||
|
// 字体大小
|
||||||
|
const { getPxValue } = useSize();
|
||||||
|
|
||||||
// 主色
|
// 主色
|
||||||
const color = ref(ctx.color["primary-500"] as string);
|
const color = ref(ctx.color["primary-500"] as string);
|
||||||
// 单元格高度
|
// 单元格高度
|
||||||
@@ -209,7 +213,15 @@ const cellHeight = ref(66);
|
|||||||
// 单元格间距
|
// 单元格间距
|
||||||
const cellGap = ref(0);
|
const cellGap = ref(0);
|
||||||
// 字体大小
|
// 字体大小
|
||||||
const fontSize = ref(14);
|
const fontSize = computed(() => {
|
||||||
|
// #ifdef APP
|
||||||
|
return getPxValue("14px");
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef APP
|
||||||
|
return 14;
|
||||||
|
// #endif
|
||||||
|
});
|
||||||
// 当前月份日期颜色
|
// 当前月份日期颜色
|
||||||
const textColor = computed(() => {
|
const textColor = computed(() => {
|
||||||
return isDark.value ? "white" : (ctx.color["surface-700"] as string);
|
return isDark.value ? "white" : (ctx.color["surface-700"] as string);
|
||||||
@@ -596,8 +608,6 @@ function onYearMonthChange(yearMonthArray: number[]) {
|
|||||||
currentYear.value = yearMonthArray[0];
|
currentYear.value = yearMonthArray[0];
|
||||||
currentMonth.value = yearMonthArray[1];
|
currentMonth.value = yearMonthArray[1];
|
||||||
|
|
||||||
console.log(yearMonthArray);
|
|
||||||
|
|
||||||
// 重新计算日历数据并重绘
|
// 重新计算日历数据并重绘
|
||||||
calculateDateMatrix();
|
calculateDateMatrix();
|
||||||
renderCalendar();
|
renderCalendar();
|
||||||
|
|||||||
Reference in New Issue
Block a user