mirror of
https://gitee.com/layui/layui.git
synced 2025-10-07 23:24:32 +08:00
refactor: 重构 dropdown 打开与关闭逻辑 (#2349)
* refactor: 重构 dropdown 打开与关闭逻辑 * chore: 优化变量 * refactor: 保留采用 elem 的 jQuery Data 进行面板打开状态的判断 * fix: 优化延时移除面板时的实例不一致的问题
This commit is contained in:
@@ -316,11 +316,19 @@ layui.use(['table', 'dropdown'], function(){
|
||||
});
|
||||
}
|
||||
},
|
||||
id: 'dropdown-table-tool',
|
||||
align: 'right', // 右对齐弹出
|
||||
style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' // 设置额外样式
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// table 滚动时移除内部弹出的元素
|
||||
var tableInst = table.getOptions('test');
|
||||
tableInst.elem.next().find('.layui-table-main').on('scroll', function() {
|
||||
dropdown.close('dropdown-table-tool');
|
||||
});
|
||||
|
||||
|
||||
// 触发表格复选框选择
|
||||
table.on('checkbox(test)', function(obj){
|
||||
|
Reference in New Issue
Block a user