Javascript 获取对象的属性的名称数组

//获取对象的属性的名称数组 类似于 ["applicationId", "application", "applicationVersion", "startDate", "endDate", "totalUsers", "subscribeUser", "subscribeStatus", "amount", "payType", "payDate", "payResult"]
        //var nameArr = Object.keys(this.form.getFieldsValue());
        var nameArr = Object.keys(source.form.getFieldsValue());

        for (var i = 0; i < nameArr.length; i++) {
          //循环每个对象的值,如果是对象的值是全局变量类型的 #{},则替换成实际的值。
          var fieldName = nameArr[i];
          //var val = this.form.getFieldValue(fieldName); //获取字段值
          var val = source.form.getFieldValue(fieldName); //获取字段值
      }

 

posted on 2020-12-04 10:11  Neo0820  阅读(1053)  评论(0编辑  收藏  举报

导航