fix: 更新 Excel.loadAll 为 Excel.bindLoadDone ,绑定事件并加载完成后再回调

This commit is contained in:
邹景立 2025-03-11 22:51:13 +08:00
parent c9601938c9
commit 1617be2961

View File

@ -42,7 +42,7 @@ define(function () {
Excel.prototype.bind = function (done, filename, selector, options) {
let that = this;
this.options = options || {}
this.loadAll(function (data) {
this.bindLoadDone(function (data) {
that.export(data, this.dataset.filename || filename, options);
}, selector);
};
@ -52,7 +52,7 @@ define(function () {
* @param done
* @param selector
*/
Excel.prototype.loadAll = function (done, selector) {
Excel.prototype.bindLoadDone = function (done, selector) {
let that = this;
$('body').off('click', selector || '[data-form-export]').on('click', selector || '[data-form-export]', function () {
let button = this, form = $(button).parents('form');