将对象设置为Redux状态时,键值将重新排序

时间:2018-06-16 14:10:43

标签: redux react-redux

将对象设置为Redux状态时,键值将重新排序。

输入对象 { ACCOUNT_ID: “27523831” bill_cycle: “7” bill_due_date: “2015年5月31日” cost_to_serve: “3631.1” CURRENT_BALANCE: “1114.13” customer_effort: “8674” 事项标识: “99” event_timestamp:“2011-07-29 23:00:00.000” new_charges: “6095” party_id: “1” previous_balance: “845.11” }

设置Redux状态后 { customer_effort:'8674' bill_due_date:'2015-05-31' event_id:'99' account_id:'27523831' party_id:'1' bill_cycle:'7' current_balance:'1114.13' cost_to_serve:'3631.1' new_charges:'6095' event_timestamp:'2011-07-29 23:00:00.000' previous_balance:'845.11' }

1 个答案:

答案 0 :(得分:0)

如果您需要依赖排序使用array,则不会对object条目进行排序,并且可能只是最后位置的条目只是最后一个更新的条目。此行为是正常的,并在Javascript中预期。根据定义,javascript中的对象:它是一个无序的属性集合

相关问题