📌fix: QSelectBox options 내용 없을경우 처리 추가
This commit is contained in:
parent
df21e6c198
commit
ba8973c593
@ -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>
|
||||
|
||||
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user