From ac4e2892a68bb4ef5b35e8e2e12e76d3ec3ede35 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 07 七月 2023 18:50:11 +0800 Subject: [PATCH] 2023-07-07 --- src/menu/components/calendar/index.jsx | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/menu/components/calendar/index.jsx b/src/menu/components/calendar/index.jsx index e4bf1fb..00a1663 100644 --- a/src/menu/components/calendar/index.jsx +++ b/src/menu/components/calendar/index.jsx @@ -175,9 +175,9 @@ res.resetContrl = card.wrap.resetContrl || 'init' if (res.colorField && res.signs) { - res.signs = res.signs.map(item => { + res.signs = res.signs.map((item, i) => { try { - let colors = item.color.match(/\d+/g) + let colors = item.background.match(/\d+/g) if ((colors[0] * 0.299 + colors[1] * 0.578 + colors[2] * 0.114) * colors[3] < 192) { item.fontColor = '#ffffff' } else { @@ -187,6 +187,13 @@ item.fontColor = '' } + item.style = {background: item.background} + if (item.fontColor) { + item.style.color = item.fontColor + } + + item.$index = i + 1 + return item }) } -- Gitblit v1.8.0