Skip to content

Commit 7171438

Browse files
authored
fix(word-cloud): 修复this指向问题 (#1668)
1 parent 53b5320 commit 7171438

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/plots/word-cloud/index.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ export class WordCloud extends Plot<WordCloudOptions> {
4848
return;
4949
}
5050

51-
processImageMask(imageMask)
52-
.then((img) => {
53-
this.options = {
54-
...this.options,
55-
imageMask: img || null,
56-
};
51+
const handler = (img: HTMLImageElement) => {
52+
this.options = {
53+
...this.options,
54+
imageMask: img || null,
55+
};
5756

58-
// 调用父类渲染函数
59-
super.render();
60-
})
61-
.catch(super.render);
57+
// 调用父类渲染函数
58+
super.render();
59+
};
60+
61+
processImageMask(imageMask).then(handler).catch(handler);
6262
}
6363

6464
/**

0 commit comments

Comments
 (0)