请问大神们这种是什么写法呢'delete'(state,{payload:id})reducers:{'delete'(state,{payload:id}){returnstate.filter(item=>item.id!==id);},}
2 回答
有只小跳蛙
TA贡献1824条经验 获得超8个赞
{payload:id}是对象解构赋值,具体参考解构赋值MDN而'delete'仅仅是对象属性名,事实上,对象的所有属性名都会被转为String如果你指的是'delete'(state,{payload:id}){}这种函数写法的话,则可以参考方法的定义MDN
添加回答
举报
0/150
提交
取消