Files
log-lottery/src/utils/store.ts
2026-01-04 11:21:49 +08:00

11 lines
356 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 提取有哪些字段
export function extractFields(data: any) {
const item = data[0]
// 排除id x y其他都加入数组
const keys = Object.keys(item).filter(key => key !== 'id' && key !== 'x' && key !== 'y')
if (keys.length > 0) {
// 返回数组key value
return keys.map(key => ({ label: key, value: true }))
}
}