diff --git a/.eslintrc.js b/.eslintrc.js index 145a9383e..0ec89fa61 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,8 +6,12 @@ module.exports = { }, extends: [ "eslint:recommended", - "plugin:vue/essential", + "plugin:vue/recommended", "plugin:prettier/recommended", "prettier", ], + rules: { + "vue/require-default-prop": "off", + "vue/attribute-hyphenation": "off", + }, }; diff --git a/assets/js/app.js b/assets/js/app.js index 5a822d1f0..83968baac 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -22,9 +22,6 @@ window.app = new Vue({ router, i18n, data: { store, notifications: [] }, - render: function (h) { - return h(App, { props: { notifications: this.notifications } }); - }, methods: { raise: function (msg) { console[msg.type](msg); @@ -56,6 +53,9 @@ window.app = new Vue({ this.raise(msg); }, }, + render: function (h) { + return h(App, { props: { notifications: this.notifications } }); + }, }); window.setInterval(function () { diff --git a/assets/js/components/Energyflow/Energyflow.vue b/assets/js/components/Energyflow/Energyflow.vue index 488b6b798..38c208722 100644 --- a/assets/js/components/Energyflow/Energyflow.vue +++ b/assets/js/components/Energyflow/Energyflow.vue @@ -5,18 +5,7 @@ @click="toggleDetails" >
@@ -136,6 +115,7 @@ import BatteryIcon from "./BatteryIcon.vue"; export default { name: "Energyflow", components: { Visualization, BatteryIcon }, + mixins: [formatter], props: { gridConfigured: Boolean, gridPower: { type: Number, default: 0 }, @@ -151,7 +131,6 @@ export default { data: function () { return { showDetails: false }; }, - mixins: [formatter], computed: { gridImport: function () { return Math.max(0, this.gridPower); diff --git a/assets/js/components/Energyflow/Visualization.vue b/assets/js/components/Energyflow/Visualization.vue index 2efa8a166..c35b9b369 100644 --- a/assets/js/components/Energyflow/Visualization.vue +++ b/assets/js/components/Energyflow/Visualization.vue @@ -13,15 +13,15 @@
-
+
- + {{ kw(selfConsumption) }} - + {{ kwNoUnit(selfConsumption) }}
@@ -29,10 +29,10 @@ class="site-progress-bar grid-import" :style="{ width: widthTotal(gridImportAdjusted) }" > - + {{ kw(gridImport) }} - + {{ kwNoUnit(gridImport) }}
@@ -40,14 +40,14 @@ class="site-progress-bar pv-export" :style="{ width: widthTotal(pvExportAdjusted) }" > - + {{ kw(pvExport) }} - + {{ kwNoUnit(pvExport) }}
-
+
{{ $t("main.energyflow.noEnergy") }}
@@ -80,6 +80,7 @@ import LabelBar from "./LabelBar.vue"; export default { name: "Visualization", components: { BatteryIcon, LabelBar, GridIcon }, + mixins: [formatter], props: { showDetails: Boolean, gridImport: { type: Number, default: 0 }, @@ -96,16 +97,6 @@ export default { data: function () { return { width: 0, visualizationReady: false }; }, - mounted: function () { - this.$nextTick(function () { - window.addEventListener("resize", this.updateElementWidth); - this.updateElementWidth(); - }); - }, - beforeDestroy() { - window.removeEventListener("resize", this.updateElementWidth); - }, - mixins: [formatter], computed: { gridExport: function () { return this.pvExport; @@ -137,6 +128,15 @@ export default { }, 500); }, }, + mounted: function () { + this.$nextTick(function () { + window.addEventListener("resize", this.updateElementWidth); + this.updateElementWidth(); + }); + }, + beforeDestroy() { + window.removeEventListener("resize", this.updateElementWidth); + }, methods: { widthTotal: function (power) { if (this.totalAdjusted === 0) return "0%"; diff --git a/assets/js/components/Loadpoint.vue b/assets/js/components/Loadpoint.vue index 570e67f99..0e62a7f39 100644 --- a/assets/js/components/Loadpoint.vue +++ b/assets/js/components/Loadpoint.vue @@ -3,15 +3,15 @@

{{ title || $t("main.loadpoint.fallbackName") }}

-