http://www.wxapp-union.com/portal.php?mod=view&aid=4464
class CanvasKit {
constructor() {
}
drawImg(option = {}) {
...
return this
}
drawRect(option = {}) {
return this
}
drawText(option = {}) {
...
return this
}
static exportImg(option = {}) {
...
}
}
let drawer = new CanvasKit('canvasId').drawImg(styleObj1).drawText(styleObj2)
drawer.exportImg()
![](https://img2018.cnblogs.com/blog/1157512/201809/1157512-20180918180320723-129188800.png)