我有一个包含多个选择过滤器的页面,例如:
const filtersOne = [{id: 1, title: "Filter one"}, {id: 2, title: "Filter two", active: true}]
const filtersTwo = [{id: 1, title: "Filter 1"}, {id: 2, title: "Filter 2", active: true}]
根据这些数据,我将渲染选择框。
我的问题是在商店中保存这些数据的最佳方法是什么?
const state = {
page: {
filters: {
filtersOne: [{id: 1, title: "Filter one"}, {id: 2, title: "Filter two", active: true}],
filtersTwo: [{id: 1, title: "Filter 1"}, {id: 2, title: "Filter 2", active: true}]
}
}
}