Skip to content

Commit 0d5295b

Browse files
committed
chore: 更新脚本
1 parent 02a1cbc commit 0d5295b

3 files changed

Lines changed: 14 additions & 1790 deletions

File tree

src/components/BootstrapBlazor.Dom2Image/wwwroot/dom2image.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { snapdom } from './lib/snapdom.min.mjs'
1+
import { snapdom } from './lib/snapdom.min.mjs'
22

3-
export async function getUrl(selector, options = {}) {
3+
export async function getUrl(selector, options) {
44
let data = null;
55
const el = document.querySelector(selector);
66
if (el) {
7-
const result = await snapdom(el, options);
7+
const result = await snapdom(el, options || {});
88
data = result.url;
99
}
1010
return data;
1111
}
1212

13-
export async function getStream(selector, options = {}) {
13+
export async function getStream(selector, options) {
1414
let data = null;
1515
const el = document.querySelector(selector);
1616
if (el) {
17-
const result = await snapdom(el, options);
17+
const result = await snapdom(el, options || {});
1818
data = result.toBlob();
1919
}
2020
return data;
@@ -23,7 +23,7 @@ export async function getStream(selector, options = {}) {
2323
export async function downloadAsync(selector, filename, format, backgroundColor, options) {
2424
const el = document.querySelector(selector);
2525
if (el) {
26-
const result = await snapdom(el, options);
26+
const result = await snapdom(el, options || {});
2727
await result.download({
2828
format,
2929
filename,

0 commit comments

Comments
 (0)