test.vue
569 Bytes
<!--
* @Date: 2025-03-20 19:53:12
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-20 23:56:05
* @FilePath: /mlaj/src/App.vue
* @Description: 文件描述
-->
<script setup>
const arr = [];
arr.push({ a: '1' });
arr.push({ a: '2', b: 'random1' });
arr.push({ a: '3', b: 'random2', c: true });
arr.push({ a: '4', b: 'random3', d: 123 });
arr.push({ a: '5', b: 'random4', e: new Date() });
const arr2 = arr.map(item => {
return {
...item,
b: 'random5'
}
})
console.warn(arr2);
</script>
<template>
</template>
<style>
</style>