1:vue 用replace修改数组中对象的键值或者字段名
//前端现在的数组
let arr = [
{"colId":"SPECIAL_DESCRIBE","colName","SPECIAL_DESCRIBE名称"},
{"colId":"CUS_NAME","colName","CUS_NAME名称"}
]
//假如后端需要的数组名字叫 array 直接定义
let array = JSON.parse(JSON.stringify(arr).replace(/colId/g,"id").replace(/colName/g,"label"))
console.log(array)
//现在你去打印就会看出来名字已经变了