12345678910111213141516171819202122232425262728 |
- import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
- // 初始化状态
- const initState = {
- // 列表数据
- tableInfo: {
- list: [] as FourTableType[],
- total: 0
- }
- }
- // 定义 action 类型
- type Props = {
- type: 'B2/getList'
- payload: { list: FourTableType[]; total: number }
- }
- // reducer
- export default function userReducer(state = initState, action: Props) {
- switch (action.type) {
- // 获取列表数据
- case 'B2/getList':
- return { ...state, tableInfo: action.payload }
- default:
- return state
- }
- }
|