📌fix: QSelectBox options 내용 없을경우 처리 추가

This commit is contained in:
yoosangwook 2025-01-07 17:19:16 +09:00
parent df21e6c198
commit ba8973c593
2 changed files with 4 additions and 0 deletions

View File

@ -536,6 +536,9 @@ export default function Playground() {
<div className="my-2">
<Button onClick={handleChangeMyData2}>QSelectBox dynamic data bind change!!</Button>
</div>
<div className="my-2">
<QSelectBox options={[]} value={{}} sourceKey="id" targetKey="raftBaseCd" showKey="clCodeNm" />
</div>
<div className="my-2">
<SampleReducer />
</div>

View File

@ -33,6 +33,7 @@ export default function QSelectBox({
* @returns {string} 초기 상태
*/
const handleInitState = () => {
if (options.length === 0) return title !== '' ? title : '선택하세요.'
if (showKey !== '' && !value) {
//value showKey
return options[0][showKey]