Skip to content

Commit 09040ed

Browse files
committed
fix: set filters slider value after page refresh
1 parent 741db48 commit 09040ed

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

adminforth/spa/src/components/CustomRangePicker.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ const emit = defineEmits(['update:valueStart', 'update:valueEnd']);
5353
const minFormatted = computed(() => Math.floor(<number>props.min));
5454
const maxFormatted = computed(() => Math.ceil(<number>props.max));
5555
56-
const isChanged = computed(() => {
57-
return start.value && start.value !== minFormatted.value || end.value && end.value !== maxFormatted.value;
58-
});
5956
6057
const start = ref<string | number>(props.valueStart);
6158
const end = ref<string | number>(props.valueEnd);
@@ -102,7 +99,15 @@ watch(end, () => {
10299
})
103100
104101
watch([minFormatted,maxFormatted], () => {
105-
setSliderValues(minFormatted.value, maxFormatted.value)
102+
if ( !start.value && end.value ) {
103+
setSliderValues(minFormatted.value, end.value);
104+
} else if ( start.value && !end.value ) {
105+
setSliderValues(start.value, maxFormatted.value);
106+
} else if ( !start.value && !end.value ) {
107+
setSliderValues(minFormatted.value, maxFormatted.value);
108+
} else {
109+
setSliderValues(start.value, end.value);
110+
}
106111
})
107112
108113
function setSliderValues(start: any, end: any) {

0 commit comments

Comments
 (0)