如何在v-file-input Vuetify中从文件对象观察器获取文件路径?

问题描述 投票:1回答:1

我正在使用Vuetify构建功能上传图像。上传到服务器之前,我需要预览图像

在v-input-file

<v-file-input
  accept="image/*"
  multiple
  label="Add your files"
  chips
  filled
  prepend-icon="mdi-camera"
  @change="onAddFiles"
></v-file-input>

更改方法时

onAddFiles(files) {
  console.log(files);
}

enter image description here

您可以看到file path数组中没有信息File object observer

我不知道如何从此file path中获取File object observer。请帮助我,我非常感谢!

javascript vue.js vuejs2 vuetify.js filepath
1个回答
1
投票
previews: [], errorImage: "url of an image to use to indicate an error",

显然,您需要将errorImage设置为有用的内容

© www.soinside.com 2019 - 2024. All rights reserved.