From f18edf97f769eff13c7998c863dda41f2df18531 Mon Sep 17 00:00:00 2001 From: morning-star <26325820+Sight-wcg@users.noreply.github.com> Date: Thu, 25 Sep 2025 19:12:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(laydate):=20=E9=A2=84=E8=A7=88=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E9=80=89=E4=B8=AD=E9=AB=98=E4=BA=AE=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=20(#2840)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/laydate.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/modules/laydate.js b/src/modules/laydate.js index 47ea0154..fae87fe2 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -2161,14 +2161,18 @@ layui.define(['lay', 'i18n'], function(exports) { // 预览颜色渐变 var oldValue = elemPreview.html(); - oldValue && (elemPreview.css({ - 'color': '#16b777' - }), - setTimeout(function(){ + if (oldValue) { + var color = layui.type(options.theme) === 'array' ? options.theme[0] : options.theme; elemPreview.css({ - 'color': '#777' + 'color': /^#/.test(String(color)) ? color : '#16b777' }); - }, 300)); + + setTimeout(function(){ + elemPreview.css({ + 'color': '#777' + }); + }, 300); + } }; // 附加的渲染处理,在 ready 和 change 的时候调用