Qselectbox 수정

This commit is contained in:
김민식 2025-01-09 18:03:02 +09:00
parent 6063c4a2e3
commit 67e02bf648

View File

@ -35,7 +35,8 @@ export default function QSelectBox({
if (options.length === 0) return title !== '' ? title : '선택하세요.'
if (showKey !== '' && !value) {
//value showKey
return options[0][showKey]
// return options[0][showKey]
return title
} else if (showKey !== '' && value) {
//value sourceKey targetKey
@ -58,6 +59,8 @@ export default function QSelectBox({
const ref = useRef(null)
const handleClickSelectOption = (option) => {
console.log('🚀 ~ handleClickSelectOption ~ option:', option)
setSelected(showKey !== '' ? option[showKey] : option.name)
onChange?.(option, params)
}