优化代码 没有参数e 报错的问题

This commit is contained in:
lVAL 2021-02-22 18:13:55 +08:00
parent e5cba385b1
commit 20ba9fbc15
9 changed files with 52 additions and 18 deletions

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -38,7 +40,8 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target) {
if (e &&
e.target) {
this.text.hide();
} else {
// this.device.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -40,7 +42,9 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -40,7 +42,9 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -38,7 +40,9 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -40,7 +42,9 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -29,7 +29,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.LimitControl.mouseOverStyle.arcColor);
@ -41,7 +43,9 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.LimitControl.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.deviceStyle.mouseOverStyle.arcColor);
@ -40,7 +42,9 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.deviceStyle.lamp.controlColor);

View File

@ -28,7 +28,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
@ -38,7 +40,8 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target) {
if (e &&
e.target) {
this.text.hide();
} else {
// this.device.setControlColor(this.device.style.LcControl.lamp.controlColor);

View File

@ -29,7 +29,9 @@ export default class EMouse extends Group {
this.text.hide();
}
mouseover(e) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
this.device.control.setControlColor(this.device.style.ZcControl.mouseOverStyle.arcColor);
@ -41,7 +43,9 @@ export default class EMouse extends Group {
mouseout(e) {
if (!this.device.__down) {
if (e.target && e.target._subType == 'Text') {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor);