Qselectbox 수정
This commit is contained in:
parent
6063c4a2e3
commit
67e02bf648
@ -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)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user