const dataList = ref([
{ num: 0, fieldKey: 'aValue', title: 'a' },
{ num: 0, fieldKey: 'bValue', title: 'b' },
]) as any;
const getData = async () => {
let res = {
aValue: 1,
bValue: 2
}
dataList.value.forEach((item) => {
item.num = res[item.fieldKey as any];
});
console.log(dataList.value); // [{ num: 1, fieldKey: 'aValue', title: 'a' }, { num: 2, fieldKey: 'bValue', title: 'b' }]
};