chore: prettier js codes

This commit is contained in:
陈嘉涵
2020-01-19 17:02:01 +08:00
parent 2adcfd8b8b
commit 1e864a445f
28 changed files with 333 additions and 174 deletions
+5 -2
View File
@@ -107,7 +107,9 @@ export default createComponent({
if (this.disabled) return;
const rect = this.$el.getBoundingClientRect();
const delta = this.vertical ? event.clientY - rect.top : event.clientX - rect.left;
const delta = this.vertical
? event.clientY - rect.top
: event.clientX - rect.left;
const total = this.vertical ? rect.height : rect.width;
const value = (delta / total) * this.range + this.min;
@@ -129,7 +131,8 @@ export default createComponent({
format(value) {
return (
Math.round(Math.max(this.min, Math.min(value, this.max)) / this.step) * this.step
Math.round(Math.max(this.min, Math.min(value, this.max)) / this.step) *
this.step
);
},
},