Commit 99e552c4499baeb9b68788652e619e8811d14d99

Authored by 李婷
1 parent 18afc5fa

feat: 修复代码

Showing 1 changed file with 2 additions and 2 deletions
@@ -113,7 +113,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { @@ -113,7 +113,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => {
113 const [selectOptions, setSelectOptions] = useState([]) 113 const [selectOptions, setSelectOptions] = useState([])
114 114
115 useEffect(() => { 115 useEffect(() => {
116 - console.log(optionId,'llllloptions') 116 + console.log(optionId,'llllloptions',options)
117 if(optionId && !options?.length) { 117 if(optionId && !options?.length) {
118 getAppFromList(optionId).then((res: any)=> { 118 getAppFromList(optionId).then((res: any)=> {
119 if(res?.length){ 119 if(res?.length){
@@ -127,7 +127,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { @@ -127,7 +127,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => {
127 } else { 127 } else {
128 setSelectOptions(options) 128 setSelectOptions(options)
129 } 129 }
130 - }, []); 130 + }, [JSON.stringify(options), optionId]);
131 131
132 return <FormSelectMain {...props} options={selectOptions}/> 132 return <FormSelectMain {...props} options={selectOptions}/>
133 }; 133 };