【发布时间】:2022-06-13 21:09:05
【问题描述】:
const handleFileChange = (e) => {
const target = e?.target?.files[0];
console.log('this is the object=', target);
console.log('this is the spreading=', { ...target' });
console.log('this is the spreading=', { ...target, type: 'image/gif' });
};
这是 Chrome 开发者工具中的输出:
为什么我不能传播对象?
【问题讨论】:
-
可能是因为它不是“标准对象”
-
请修改您的帖子标题以提出明确、具体的问题。见How to Ask。
-
文件不是对象,而是
Blob。
标签: javascript