getObjectURL(file) {
      var url = null;
      if (window.createObjectURL != undefined) {
        url = window.createObjectURL(file);
      } else if (window.URL != undefined) {
        url = window.URL.createObjectURL(file);
      } else if (window.webkitURL != undefined) {
        url = window.webkitURL.createObjectURL(file);
      }
      return url;
    },

以上,我们通过将文件对象传入,即可返回图片的url .

若是其他文件内容,我们直接用对象.name  直接展示文件名称即可。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2021-07-26
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-06-18
猜你喜欢
  • 2022-01-12
  • 2022-12-23
  • 2021-12-24
  • 2021-09-25
  • 2021-04-03
  • 2022-12-23
相关资源
相似解决方案