From d3f112160cac52b49f42b97e144a2f8c3c72a115 Mon Sep 17 00:00:00 2001 From: sunxb <470459819@qq.com> Date: Tue, 31 Jan 2023 10:55:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=8D=E9=80=89=E6=A1=86?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=95=88=E6=9E=9C=E8=B7=9F2.8.0-rc.6?= =?UTF-8?q?=E4=B8=80=E8=87=B4=EF=BC=8C=E5=BE=AE=E8=B0=83=E5=A4=8D=E9=80=89?= =?UTF-8?q?skin=E7=9A=84=E5=80=BC=E7=9A=84=E7=BB=86=E8=8A=82=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/form.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/form.js b/src/modules/form.js index 9f97afca..f7df7b8a 100644 --- a/src/modules/form.js +++ b/src/modules/form.js @@ -651,12 +651,16 @@ layui.define(['lay', 'layer', 'util'], function(exports){ checks.each(function(index, check){ var othis = $(this); - var skin = othis.attr('lay-skin') || ''; + var skin = othis.attr('lay-skin') || 'primary'; check.title || (check.title = othis.attr('lay-text') || ''); // 向下兼容将以前设置在lay-text的值赋给title var title = (check.title.replace(/\s/g, '') || '').split('|'); var disabled = this.disabled; - if(skin === 'switch') skin = '_'+ skin; + if(skin === 'switch') { + skin = '_'+ skin; + } else if (skin !== 'tag') { + skin = 'primary'; + } var RE_CLASS = CLASS[skin] || CLASS.checkbox; if(typeof othis.attr('lay-ignore') === 'string') return othis.show();