keyof
类型判定时可能是interface中的某一个类型
interface ColorValue {
hex: string
hsl: ColorHSLValue
rgb: ColorRGBAValue
}
interface ColorPickerInputProps {
value?: ColorValue[keyof ColorValue] // 重点看这行
mode?: 'hex' | 'hsl' | 'rgb'
onChange?: (value: ColorValue[keyof ColorValue], event?: any) => void
presetColors?: string[]
}