需注意this指向变化问题
import SparkMD5 from 'spark-md5'
handleChangePackage (file, fileList) { this.packageList = [] this.packageList = fileList const _this = this const fileReader = new FileReader() const dataFile = file.raw const spark = new SparkMD5.ArrayBuffer() fileReader.readAsArrayBuffer(dataFile) fileReader.onload = function (e) { spark.append(e.target.result) const md5 = spark.end() _this.softwareForm.md5 = md5 } },