老师,我看了6-10完成了list的删除,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | handleDelete(index){ const action = { type: "delete_item" , index } dispatch(action) } 可是 if (action.type === 'delete_item' ){ const newState = {...state}; newState.list.splice(action.index,1); console.log(newState.list); //这里打出来删掉了 return newState; } 页面中没有删除掉,是为什么呢 |