/** * js检查数组中的属性值不能重复 * @param list 要检查的数组 * @param prop key */ export function useArrayDataUnique(list: any, prop: string) { return ( new Set(list.map((item: { [key: string]: string | number }) => item[prop])).size === list.length ) }