fix(laydate): 预览区域选中高亮跟随主题 (#2840)

main
morning-star 2025-09-25 19:12:11 +08:00 committed by GitHub
parent 3940c45654
commit f18edf97f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 6 deletions

View File

@ -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 的时候调用