1.imgthing爲一個空對象{},經過點或者['']的方式設置 javascript
data () { return { imgthing:{} } } //file是一個上傳文件對象 methods: { changeUpload (file, fileList) { //方式1: this.imgthing.identityCard_Z = file //方式2: //this.imgthing['identityCard_Z'] = file console.log(this.imgthing) }
讀取數據:html
//方式1: this.imgthing.identityCard_Z //方式2: this.imgthing['identityCard_Z']
兩個對象合併java
this.Imgthing = Object.assign(this.Imgthing,imgthing)
參考文檔:ide
1.Javascript 對象(object)合併:https://www.cnblogs.com/yes-V-can/p/5631645.htmlthis