数字转换成字符串 const difficulty = [ { value: 1, label: '简单' }, { value: 2, label: '一般' }, { value: 3, label: '困难' } ] 后端返回 渲染成: 方法 const numberDifficulty = difficulty.reduce((acc, cur) => { acc[cur.value] = cur.label return acc }, {})