Commit 87ee7cd27a6123a042ab0918e07580276d77be85
Committed by
GitHub
1 parent
ce030d2d
处理(Warning 'Use of eval is strongly discouraged')警告 (#2424)
Showing
1 changed file
with
1 additions
and
1 deletions
src/components/Form/src/hooks/useFormEvents.ts
... | ... | @@ -93,7 +93,7 @@ export function useFormEvents({ |
93 | 93 | } else { |
94 | 94 | nestKeyArray.forEach((nestKey: string) => { |
95 | 95 | try { |
96 | - const value = eval('values' + delimiter + nestKey); | |
96 | + const value = nestKey.split('.').reduce((out, item) => out[item], values); | |
97 | 97 | if (isDef(value)) { |
98 | 98 | formModel[nestKey] = value; |
99 | 99 | validKeys.push(nestKey); | ... | ... |