Skip to content

Commit

Permalink
fix: 对象嵌套拖拽报错 (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengshang918 committed Dec 28, 2021
1 parent 96dbcde commit a45f4a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/generator/src/hooks/useAddField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: jiangxiaowei
* @Date: 2021-10-08 10:20:13
* @Last Modified by: jiangxiaowei
* @Last Modified time: 2021-11-22 13:45:43
* @Last Modified time: 2021-12-27 16:40:13
*/
import { useCallback, useContext } from 'react'
import { nanoid } from 'nanoid'
Expand Down Expand Up @@ -81,8 +81,8 @@ const useAddField = (): AddField => {
}
}
} else {
// 拖拽到对象容器上,对象容器内无元素时,fieldKey不变化
newFieldKey = oldFieldKey
// 拖拽到对象容器上,对象容器内无元素时,fieldKey取最后
newFieldKey = lastFieldKey
}
}
selectKey = `${parentKey ? `${parentKey}.` : ''}${newFieldKey}`
Expand Down

0 comments on commit a45f4a7

Please sign in to comment.