Skip to content

Commit

Permalink
some refactoring done in range slider
Browse files Browse the repository at this point in the history
  • Loading branch information
devansh-webkul committed Jun 22, 2023
1 parent 9134c33 commit d04fc2d
Showing 1 changed file with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,9 @@ class="absolute w-full h-[4px] appearance-none pointer-events-none bg-transparen
computed: {
rangeText() {
/**
* If someone is passing invalid props, this case will check first if they are valid, then continue.
*/
if (this.isTypeSupported()) {
switch (this.defaultType) {
case 'price':
return `${this.$shop.formatPrice(this.minRange)} - ${this.$shop.formatPrice(this.maxRange)}`;
case 'float':
return `${parseFloat(this.minRange).toFixed(2)} - ${parseFloat(this.maxRange).toFixed(2)}`;
let { formattedMinRange, formattedMaxRange } = this.getFormattedData();
default:
return `${this.minRange} - ${this.maxRange}`
}
}
/**
* Otherwise, we will load the default formatting.
*/
return `${this.minRange} - ${this.maxRange}`;
return `${formattedMinRange} - ${formattedMaxRange}`;
},
},
Expand Down

0 comments on commit d04fc2d

Please sign in to comment.