【问题标题】:Spreading the object传播对象
【发布时间】: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


猜你喜欢
  • 2015-12-31
  • 2018-05-07
  • 1970-01-01
  • 1970-01-01
  • 2018-10-18
  • 1970-01-01
  • 2017-04-12
  • 1970-01-01
相关资源
最近更新 更多