Commit 87ee7cd27a6123a042ab0918e07580276d77be85

Authored by yaoyylm
Committed by GitHub
1 parent ce030d2d

处理(Warning 'Use of eval is strongly discouraged')警告 (#2424)

src/components/Form/src/hooks/useFormEvents.ts
@@ -93,7 +93,7 @@ export function useFormEvents({ @@ -93,7 +93,7 @@ export function useFormEvents({
93 } else { 93 } else {
94 nestKeyArray.forEach((nestKey: string) => { 94 nestKeyArray.forEach((nestKey: string) => {
95 try { 95 try {
96 - const value = eval('values' + delimiter + nestKey); 96 + const value = nestKey.split('.').reduce((out, item) => out[item], values);
97 if (isDef(value)) { 97 if (isDef(value)) {
98 formModel[nestKey] = value; 98 formModel[nestKey] = value;
99 validKeys.push(nestKey); 99 validKeys.push(nestKey);