0

嗨,我想为大写实现表单规范化,就像这里Normalizing Form Data

const reducer = combineReducers({
  // other reducers
  form: form.normalize({
    normalizing: {                                    // <--- name of the form
      upper: value => value && value.toUpperCase(),   // normalizer for 'upper' field
      phone: normalizePhone,                          // normalizer for 'phone' field
      min: normalizeMin,                              // normalizer for 'min' field
      max: normalizeMax                               // normalizer for 'max' field
    }
  })
});

我有 100 个字段,我不想写每个字段,而是传递某种数组,类似的东西。

const reducer = combineReducers({
  // other reducers
  form: form.normalize({
    normalizing: {                                    // <--- name of the form
      fieldsArray: value => value && value.toUpperCase(),   // normalizer for 'upper' field
    }
  })
});

如何实现?

4

1 回答 1

0

Erik R在他的项目中发布了答案
https://github.com/erikras/redux-form/issues/685

于 2016-02-28T14:14:41.063 回答