소스 검색

fix: fix error message about "no-prototype-builtins" after run project

DavidQinqianWu 6 달 전
부모
커밋
64ec1206e8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/components/Form/src/helper/index.ts

+ 1 - 1
src/components/Form/src/helper/index.ts

@@ -161,7 +161,7 @@ export const initModel = (schema: FormSchema[], formModel: Recordable) => {
   // 如果 schema 对应的 field 不存在,则删除 model 中的对应的 field
   for (let i = 0; i < schema.length; i++) {
     const key = schema[i].field
-    if (!model.hasOwnProperty(key)) {
+    if (!Object.prototype.hasOwnProperty.call(model, key)) {
       delete model[key]
     }
   }