<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)
};
},