filePicker
+index" title="气瓶图片" :limit="4" :value="gasImgs[index]"
autoUpload="false" :imageStyles="imageStyles" @select="handleSelect(index,$event)"
@delete="handleDelete(index,$event)" @success="handleSuccess(index,$event)"><image src="/static/upload.png" style="width: 90px;height: 90px;" mode="aspectFit"></image>
</uni-file-picker>
this.$refs["filePicker0"].clearFiles(0);
2 个回复
a***@163.com
:ref="filePicker+index"这个里面的filePicker是个变量吗?
7***@qq.com
组件v-for循环导致 this.$refs[key] 的值可能是个数组
let rf = this.$refs[key]
if (Array.isArray(rf) && rf[0]) {
rf[0].clearFiles(0) //特殊情况
} else {
rf.clearFiles(0) //正常情况下
}