Integrated eslint and reformatted all of the JS/TS
This commit is contained in:
@@ -1,69 +1,69 @@
|
||||
'use strict'
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
replace: true,
|
||||
template: '#templated-input-template',
|
||||
props: ['name', 'model', 'template'],
|
||||
replace: true,
|
||||
template: "#templated-input-template",
|
||||
props: ["name", "model", "template"],
|
||||
|
||||
data: function () {
|
||||
return { view: '' }
|
||||
},
|
||||
|
||||
computed: {
|
||||
metric: function () {
|
||||
return this.$root.display_units === "METRIC";
|
||||
data: function () {
|
||||
return { view: "" };
|
||||
},
|
||||
|
||||
_view: function () {
|
||||
if (this.template.scale) {
|
||||
if (this.metric) {
|
||||
return 1 * this.model.toFixed(3);
|
||||
computed: {
|
||||
metric: function () {
|
||||
return this.$root.display_units === "METRIC";
|
||||
},
|
||||
|
||||
_view: function () {
|
||||
if (this.template.scale) {
|
||||
if (this.metric) {
|
||||
return 1 * this.model.toFixed(3);
|
||||
}
|
||||
|
||||
return 1 * (this.model / this.template.scale).toFixed(4);
|
||||
}
|
||||
|
||||
return this.model;
|
||||
},
|
||||
|
||||
units: function () {
|
||||
return (this.metric || !this.template.iunit)
|
||||
? this.template.unit
|
||||
: this.template.iunit;
|
||||
},
|
||||
|
||||
title: function () {
|
||||
let s = `Default :${this.template.default} ${(this.template.unit || "")}`;
|
||||
|
||||
if (typeof this.template.help != "undefined") {
|
||||
s = `${this.template.help}\n${s}`;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
return 1 * (this.model / this.template.scale).toFixed(4);
|
||||
}
|
||||
|
||||
return this.model;
|
||||
},
|
||||
|
||||
units: function () {
|
||||
return (this.metric || !this.template.iunit)
|
||||
? this.template.unit
|
||||
: this.template.iunit;
|
||||
watch: {
|
||||
_view: function () {
|
||||
this.view = this._view;
|
||||
},
|
||||
|
||||
view: function () {
|
||||
if (this.template.scale && !this.metric) {
|
||||
this.model = this.view * this.template.scale;
|
||||
} else {
|
||||
this.model = this.view;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
title: function () {
|
||||
var s = `Default :${this.template.default} ${(this.template.unit || '')}`;
|
||||
|
||||
if (typeof this.template.help != 'undefined') {
|
||||
s = this.template.help + '\n' + s;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
_view: function () {
|
||||
this.view = this._view
|
||||
ready: function () {
|
||||
this.view = this._view;
|
||||
},
|
||||
|
||||
view: function () {
|
||||
if (this.template.scale && !this.metric) {
|
||||
this.model = this.view * this.template.scale;
|
||||
} else {
|
||||
this.model = this.view;
|
||||
}
|
||||
methods: {
|
||||
change: function () {
|
||||
this.$dispatch("input-changed");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ready: function () {
|
||||
this.view = this._view
|
||||
},
|
||||
|
||||
methods: {
|
||||
change: function () {
|
||||
this.$dispatch('input-changed')
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user