From 9299cccc504c36e82e7bd1938b231e87b8eca2e6 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 20 Jul 2020 16:58:54 +0200 Subject: [PATCH] fix errori generici in chart e combo --- .../src/app_modules_thermo/components/combo.ts | 11 ++++++----- .../src/app_modules_thermo/components/svgChart.ts | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.ts index 7a418107..e071b357 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/combo.ts @@ -12,13 +12,14 @@ export default class Combo extends Vue { get options() { let result: { id: number, text: string, anim: string }[] = []; - for (const key in this.value.enumVal) { - if (this.value.enumVal.hasOwnProperty(key)) { - const element = this.value.enumVal[key]; + if (this.value.enumVal) + for (const key in this.value.enumVal) { + if (this.value.enumVal.hasOwnProperty(key)) { + const element = this.value.enumVal[key]; - result.push({ id: parseInt(key), text: element.text, anim: element.anim }) + result.push({ id: parseInt(key), text: element.text, anim: element.anim }) + } } - } return result; } diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/components/svgChart.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/components/svgChart.ts index 333a1eef..d0cacea4 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/components/svgChart.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/components/svgChart.ts @@ -12,7 +12,7 @@ export default class SVGChart extends Vue { @Prop({ default: [] }) bars: svg.BarChartInfo[]; - @Prop({ default: [] }) + @Prop({ default: function () { return [] } }) lines: svg.LineChartInfo[] @Prop()