fix(table): 修复 table 在没有大小的容器中渲染时列宽异常 (#2376)

* fix(table): 修复 table 在没有大小的容器中渲染时列宽异常

* update
This commit is contained in:
morning-star 2024-12-10 16:57:40 +08:00 committed by GitHub
parent 4c239a8921
commit e9b4febe25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -494,7 +494,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
isNone = parent.css('display') === 'none';
} catch(e){}
var parentElem = parent.parent();
if(parent[0] && parentElem && parentElem.nodeType === 1 && (!width || isNone)) return getWidth(parentElem);
if(parent[0] && parentElem[0] && parentElem[0].nodeType === 1 && (!width || isNone)) return getWidth(parentElem);
return width;
};
return getWidth();