Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/packages/printarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export default class {
init() {
this.counter++;
this.settings.id = `printArea_${this.counter}`;
let PrintAreaWindow = this.getPrintWindow(); // 创建iframe
const PrintAreaWindow = this.getPrintWindow(); // 创建iframe
this.write(PrintAreaWindow.doc); // 写入内容
this.print(PrintAreaWindow);
this.settings.endCallback();

}
print(PAWindow) {
let paWindow = PAWindow.win;
Expand Down Expand Up @@ -214,9 +214,9 @@ export default class {
};
}
Iframe() {
let frameId = this.settings.id;
const frameId = this.settings.id;
let iframe;
let that = this
const that = this;
try {
iframe = document.createElement('iframe');
document.body.appendChild(iframe);
Expand All @@ -231,7 +231,7 @@ export default class {
iframe.doc = null;
iframe.doc = iframe.contentDocument ? iframe.contentDocument : (iframe.contentWindow ? iframe.contentWindow.document : iframe.document);
iframe.onload = function () {
var win = iframe.contentWindow || iframe;
const win = iframe.contentWindow || iframe;
that.print(win);
}
} catch (e) {
Expand All @@ -244,4 +244,4 @@ export default class {

return iframe;
}
}
}