// 简单的模拟枚举 export function createEnum(arr = []) { let obj = {} arr.forEach(v => { obj[obj[v.name] = v.value] = v.name; }) return Object.freeze(obj); };