fix: 解决disable内外不统一问题

This commit is contained in:
0JARVIS0 2019-12-09 11:46:07 +08:00
parent abc9464ec2
commit 5f84e5943e

View File

@ -15,6 +15,7 @@ Component({
paintCount: 0, paintCount: 0,
currentPalette: {}, currentPalette: {},
movingCache: {}, movingCache: {},
outterDisabled: false,
isDisabled: false, isDisabled: false,
needClear: false, needClear: false,
/** /**
@ -76,6 +77,7 @@ Component({
disableAction: { disableAction: {
type: Boolean, type: Boolean,
observer: function (isDisabled) { observer: function (isDisabled) {
this.outterDisabled = isDisabled
this.isDisabled = isDisabled this.isDisabled = isDisabled
} }
}, },
@ -637,6 +639,7 @@ Component({
this.globalContext || (this.globalContext = wx.createCanvasContext('k-canvas', this)); this.globalContext || (this.globalContext = wx.createCanvasContext('k-canvas', this));
new Pen(this.bottomContext, palette).paint(() => { new Pen(this.bottomContext, palette).paint(() => {
this.isDisabled = false; this.isDisabled = false;
this.isDisabled = this.outterDisabled;
this.triggerEvent('didShow'); this.triggerEvent('didShow');
}); });
this.globalContext.draw(); this.globalContext.draw();