fix(component): 优化 render, events 执行的条件 (#2643)

This commit is contained in:
贤心 2025-04-17 23:16:17 +08:00 committed by GitHub
parent 1f2fc91431
commit 3617209874
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,14 +152,14 @@ layui.define(['jquery', 'lay'], function(exports) {
}
// 渲染
if (typeof settings.render === 'function') {
if (typeof that.render === 'function') {
component.cache.id[options.id] = null; // 记录所有实例 id用于批量操作如 resize
elem.attr(MOD_ID, options.id); // 目标元素已渲染过的标记
that.render(rerender); // 渲染核心
}
// 事件
typeof settings.events === 'function' && that.events();
typeof that.events === 'function' && that.events();
};
// 组件必传项