修复 treeTable 新增根节点时没有带选中状态的节点在初始化的时候报错的问题 (#1414)

Co-authored-by: sunxiaobin <sunxiaobin@kailashtech>
pull/1415/head
sunxiaobin89 2023-10-31 13:13:43 +08:00 committed by GitHub
parent d058c58456
commit 6681db80a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1291,7 +1291,7 @@ layui.define(['table'], function (exports) {
// 若未传入 LAY_CHECKED 属性,则继承父节点的 checked 状态
layui.each(newNodes, function(i, item){
if(!(checkName in item)){
if(!(checkName in item) && parentNode){
item[checkName] = parentNode[checkName];
}
})