📌fix: QSelectBox 기본값 조건 변경

- 컴포넌트 하나로 여러 탭에서 새용시 기본값 보여주는 로직 수정
This commit is contained in:
yoosangwook 2025-01-07 15:55:57 +09:00
parent 82bc00e2aa
commit 7e3ef71482

View File

@ -32,20 +32,16 @@ export default function QSelectBox({
* @returns {string} 초기 상태
*/
const handleInitState = () => {
//title ( )
if (title !== '') {
return title
}
//value showKey
if (showKey !== '' && !value) {
//value showKey
return options[0][showKey]
}
//value sourceKey targetKey
if (showKey !== '' && value) {
} else if (showKey !== '' && value) {
//value sourceKey targetKey
const option = options.find((option) => option[sourceKey] === value[targetKey])
return option[showKey]
} else {
// .
return title !== '' ? title : '선택하세요.'
}
}