file作为afterRead回调的默认参数,当使用在v-for里面,还需要item、index等其余参数时,可以写成下面的回调形式
<div class="company_info" v-for="(item, index) in corpList" :key="index">
<van-uploader class="uploader_wrapper"
:after-read="(file) => afterRead(file, index)"
v-model="authList[index].authListImgs"
>
<div class="uploader uploader2">
<van-image
width="130px"
:max-count="1"
:src="item.FasttdfsId"
/>
</div>
</van-uploader>
</div>
data() {
return {
corpList: [{ ...corpList }],
};
},
methods: {
afterRead(file,index) {
this.corpList[index].FastdfsId = file.content;
},
}