From 4a03a5add10ada7efb0aae4b809e47c2607dd9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sat, 22 Apr 2023 16:12:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20checkbox=20=E5=8D=8A?= =?UTF-8?q?=E9=80=89=E5=AF=B9=E5=BA=94=E7=9A=84=20className=20=E5=B8=B8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/form.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/form.js b/src/modules/form.js index 778dde2e..8d922219 100644 --- a/src/modules/form.js +++ b/src/modules/form.js @@ -623,7 +623,8 @@ layui.define(['lay', 'layer', 'util'], function(exports){ ,checkbox: function(elem){ var CLASS = { "checkbox": ['layui-form-checkbox', 'layui-form-checked', 'checkbox'], - "switch": ['layui-form-switch', 'layui-form-onswitch', 'switch'] + "switch": ['layui-form-switch', 'layui-form-onswitch', 'switch'], + SUBTRA: 'layui-icon-subtraction' }; var checks = elem || elemForm.find('input[type=checkbox]'); // 风格 @@ -644,7 +645,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){ if(check[0].disabled) return; if (check[0].indeterminate) { check[0].indeterminate = false; - reElem.find('.layui-icon-subtraction').removeClass('layui-icon-subtraction').addClass('layui-icon-ok') + reElem.find(CLASS.SUBTRA).removeClass(CLASS.SUBTRA).addClass('layui-icon-ok') } @@ -691,7 +692,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){ // 复选框 "checkbox": [ (title[0] ? (''+ util.escape(title[0]) +'') : '') - ,'' + ,'' ].join(''), // 开关