鉴于我有一个数组。
var myKey = "myObjectKey";
var anArray = ["apple", "balloon", "dog", "cat"];
anArray.map(function(thing) {
store.dispatch(Object.assign({type: 'ADD_ITEM', payload: thing, key: myKey}));
});
如何获得以下输出?
store.getState();
# Object: {myObjectKey: ["apple", "balloon", "dog", "cat"]}
答案 0 :(得分:3)
这应该有效。只需将DataTable.DefaultView.Sort = "ColumnName ASC"
DataTable = DataTable.DefaultView.ToTable
传递给调度即可。它将在减速器中进行处理
object