【发布时间】:2017-09-04 13:07:35
【问题描述】:
我总是收到这样的错误:
未捕获(承诺中)类型错误:无法读取属性 'periodListSchema' 未定义
这是我的代码:
我的架构
import { schema, arrayOf } from 'normalizr';
export const periodSchema = new schema.Entity('activePeriod');
export const periodListSchema = new schema.Array(periodSchema);
我的标准化操作
then(response => {
console.log('normalized response', normalize(response.schema.periodListSchema));
这是我的回应
{"activePeriod":[{"periodID":2,"periodName":"Periode 27","startDate":"2016-11-11","endDate":"2016-12-11","remark":"Periode Alpha 27","isActive":"1"}],"status":"OK"}
我的 Normalzr 库是 v3.2.2 有人可以帮我找出问题所在吗?我正在努力理解这一点。
【问题讨论】: