对象复制
            
            
              javascript
              
              
            
          
          // 对象复制
this.documentsTemp = Object.assign({}, this.documentsInit)数组复制
            
            
              javascript
              
              
            
          
          // 数组复制是用slice()
this.documentsTemp = this.documentsInit.slice()完整示例
            
            
              javascript
              
              
            
          
          // 赋值(赋引用 实质是两个指向同一个对象)
this.form = res.data
// 对象复制,初始化 清缓存,不能使用简单赋值语句 是指向同一个对象 应使用对象复制方式
// this.documentsTemp = Object.assign({}, this.documentsInit)
// 数组复制是用slice()
this.documentsTemp = this.documentsInit.slice()
// like12 add,20230924,电子档案处理
if (res.data.documents && res.data.documents.length > 0) {
  res.data.documents.forEach(e => {
    this.documentsTemp[e.fileFlag] = e
  })
}
this.form.documents = this.documentsTemp参考: