绩效考核手机版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
300 B

3 years ago
/**
* @description: 数组item查询
* @param {Array} list
* @param {String} key
* @param {*} value
*/
export default function arrayFind(list = [], key, value, attr) {
const item = list.find(item => item[key] == value);
if (typeof attr !== 'undefined') return item?.[attr];
return item;
}