数字转换成字符串
数字转换成字符串
const difficulty = [
{
value: 1,
label: '简单'
},
{
value: 2,
label: '一般'
},
{
value: 3,
label: '困难'
}
]
后端返回
渲染成:
方法
const numberDifficulty = difficulty.reduce((acc, cur) => {
acc[cur.value] = cur.label
原创
2021-09-05 21:32:35 ·
99 阅读 ·
0 评论