diff --git a/src/components/Settings/components/Appearance.vue b/src/components/Settings/components/Appearance.vue index 1c7e000b..d37b9d21 100644 --- a/src/components/Settings/components/Appearance.vue +++ b/src/components/Settings/components/Appearance.vue @@ -159,13 +159,13 @@ function changeWallpaper(url: string) { - + - + diff --git a/src/components/Settings/components/SearchPage.vue b/src/components/Settings/components/SearchPage.vue index f88dc085..afeb0452 100644 --- a/src/components/Settings/components/SearchPage.vue +++ b/src/components/Settings/components/SearchPage.vue @@ -214,13 +214,13 @@ function changeWallpaper(url: string) { - + - + diff --git a/src/components/Slider.vue b/src/components/Slider.vue index 2dbad6fa..84471e50 100644 --- a/src/components/Slider.vue +++ b/src/components/Slider.vue @@ -4,7 +4,7 @@ import type { Ref } from 'vue' interface Props { min?: number max?: number - value: number + modelValue: number label: string } const props = withDefaults(defineProps(), { @@ -12,23 +12,23 @@ const props = withDefaults(defineProps(), { max: 100, }) -const emit = defineEmits(['update:value']) +const emit = defineEmits(['update:modelValue']) -const modelValue = ref(props.value) -const rangeRef = ref() as Ref +const modelValue = ref(props.modelValue) +const rangeRef = ref() as Ref onMounted(() => { - modelValue.value = props.value - const progress = (modelValue.value / rangeRef.value!.max) * 100 + modelValue.value = props.modelValue + const progress = (modelValue.value / Number(rangeRef.value.max)) * 100 rangeRef.value.style.background = `linear-gradient(to right, var(--bew-theme-color) ${progress}%, var(--bew-fill-1) ${progress}%) no-repeat` if (rangeRef.value) { rangeRef.value.addEventListener('input', (event: Event) => { - const tempSliderValue = event.target!.value - emit('update:value', tempSliderValue) + const tempSliderValue = Number((event.target as HTMLInputElement).value) + emit('update:modelValue', Number(tempSliderValue)) - const progress = (tempSliderValue / rangeRef.value!.max) * 100 + const progress = (tempSliderValue / Number(rangeRef.value.max)) * 100 rangeRef.value.style.background = `linear-gradient(to right, var(--bew-theme-color) ${progress}%, var(--bew-fill-1) ${progress}%) no-repeat` }) @@ -40,7 +40,7 @@ onMounted(() => {