12345678910111213141516171819202122232425 |
- import { A6ListType } from '@/pages/A6statistics/data'
- // 初始化状态
- const initState = {
- // 列表数据
- info: { list: [], flag: false } as { list: A6ListType[]; flag: boolean }
- }
- // 定义 action 类型
- type Props = {
- type: 'A6/getInfo'
- payload: { list: A6ListType[]; flag: boolean }
- }
- // reducer
- export default function userReducer(state = initState, action: Props) {
- switch (action.type) {
- // 获取列表数据
- case 'A6/getInfo':
- return { ...state, info: action.payload }
- default:
- return state
- }
- }
|