日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無先后,達(dá)者為師

網(wǎng)站首頁 編程語言 正文

readAsText 讀取本地文件

作者:茶荼 更新時(shí)間: 2021-12-27 編程語言
<el-upload class="upload-demo"
                       action="#"
                       :on-change="handleChange"
                       :file-list="fileList"
                       :limit="3"
                       :on-exceed="handleExceed">
              <el-button size="small"
                         type="primary">上傳文件</el-button>
            </el-upload>
handleChange (file) {
      let reader = new FileReader();
      if (typeof FileReader === "undefined") {
        this.$message({
          type: "info",
          message: "您的瀏覽器不支持文件讀取。"
        });
        return;
      }
      reader.readAsText(file.raw, "utf-8");
      var _this = this;
      reader.onload = function (e) {
        _this.textInfo = e.target.result;
        console.log('textInfo', _this.textInfo)
      };
    },

原文鏈接:https://blog.csdn.net/qq_34414994/article/details/121516049

欄目分類
最近更新