(ctx, canvasId)
| 1 | export default class WxCanvas { |
| 2 | constructor(ctx, canvasId) { |
| 3 | this.ctx = ctx; |
| 4 | this.canvasId = canvasId; |
| 5 | this.chart = null; |
| 6 | |
| 7 | WxCanvas.initStyle(ctx); |
| 8 | this.initEvent(); |
| 9 | } |
| 10 | |
| 11 | getContext(contextType) { |
| 12 | return contextType === '2d' ? this.ctx : null; |