More eslint tweaks

This commit is contained in:
David Carley
2022-09-07 17:51:16 +00:00
parent 051e712b53
commit f91dc1d756
26 changed files with 312 additions and 301 deletions

View File

@@ -5,16 +5,16 @@ module.exports = {
template: "#templated-input-template",
props: [ "name", "model", "template" ],
data: function () {
data: function() {
return { view: "" };
},
computed: {
metric: function () {
metric: function() {
return this.$root.display_units === "METRIC";
},
_view: function () {
_view: function() {
if (this.template.scale) {
if (this.metric) {
return 1 * this.model.toFixed(3);
@@ -26,13 +26,13 @@ module.exports = {
return this.model;
},
units: function () {
units: function() {
return (this.metric || !this.template.iunit)
? this.template.unit
: this.template.iunit;
},
title: function () {
title: function() {
let s = `Default :${this.template.default} ${(this.template.unit || "")}`;
if (typeof this.template.help != "undefined") {
@@ -44,11 +44,11 @@ module.exports = {
},
watch: {
_view: function () {
_view: function() {
this.view = this._view;
},
view: function () {
view: function() {
if (this.template.scale && !this.metric) {
this.model = this.view * this.template.scale;
} else {
@@ -57,12 +57,12 @@ module.exports = {
}
},
ready: function () {
ready: function() {
this.view = this._view;
},
methods: {
change: function () {
change: function() {
this.$dispatch("input-changed");
}
}