0
点赞
收藏
分享

微信扫一扫

前端项目实战90-前端中getPrimaryKey方法分析

眼君 2022-10-29 阅读 119
前端开发

const getPrimaryKey = (resource: string, primaryKeys: 
Map<string, PrimaryKey>) => {
return primaryKeys.get(resource) || ['id'];
}

判断当前得map属性中有没有该属性 有就返回该属性得值

否则返回["id"]

传入值

前端项目实战90-前端中getPrimaryKey方法分析_其它

输出

["id"]

目前项目中返回得都是["id"]



举报

相关推荐

0 条评论