fix(ui): align ColorHueRange model binding (#681)

Co-authored-by: whyXVI <lain_zcb@bupt.edu.cn>
This commit is contained in:
s3d-i
2025-10-29 03:43:02 +08:00
committed by GitHub
co-authored by whyXVI
parent 4536ea6e89
commit 076c597de9
@@ -1,18 +1,27 @@
<script setup lang="ts">
import { computed } from 'vue'
const props = defineProps<{
disabled?: boolean
class?: string
}>()
const colorValue = defineModel<string>('colorValue', {
type: String,
default: '',
const modelValue = defineModel<number>({ required: true })
const sliderValue = computed({
get: () => modelValue.value,
set: (value: number) => {
if (Number.isNaN(value))
return
modelValue.value = value
},
})
</script>
<template>
<input
v-model="colorValue"
v-model.number="sliderValue"
type="range" min="0" max="360" step="0.01"
class="color-hue-range"
transition="all ease-in-out duration-250"