修改在树形组件中使用长数字字符串作为节点id时setChecked出现的问题

pull/1115/head
ZZZping 2022-08-08 15:08:47 +08:00
parent 1f70305f22
commit a74548b040
1 changed files with 72 additions and 72 deletions

View File

@ -760,7 +760,7 @@ layui.define('form', function(exports){
//若返回数字 //若返回数字
if(typeof checkedId === 'number'){ if(typeof checkedId === 'number'){
if(thisId == checkedId){ if(thisId.toString() == checkedId.toString()){
if(!input[0].checked){ if(!input[0].checked){
reInput.click(); reInput.click();
}; };
@ -770,7 +770,7 @@ layui.define('form', function(exports){
//若返回数组 //若返回数组
else if(typeof checkedId === 'object'){ else if(typeof checkedId === 'object'){
layui.each(checkedId, function(index, value){ layui.each(checkedId, function(index, value){
if(value == thisId && !input[0].checked){ if(value.toString() == thisId.toString() && !input[0].checked){
reInput.click(); reInput.click();
return true; return true;
} }