zxlie 7 年之前
父节点
当前提交
bbb80dde62
共有 2 个文件被更改,包括 6 次插入7 次删除
  1. 0 0
      v2.0/apps/image-base64/index.html
  2. 6 7
      v2.0/apps/image-base64/index.js

文件差异内容过多而无法显示
+ 0 - 0
v2.0/apps/image-base64/index.html


+ 6 - 7
v2.0/apps/image-base64/index.js

@@ -60,13 +60,12 @@ new Vue({
 
 
         _getDataUri: function (file) {
         _getDataUri: function (file) {
             let reader = new FileReader();
             let reader = new FileReader();
-            let that = this;
-            reader.onload = function (evt) {
-                that.resultContent = evt.target.result;
-                that.previewSrc = evt.target.result;
-                that.$refs.panelBox.style.backgroundImage = 'none';
-                that.sizeOri = that._sizeFormat(file.size);
-                that.sizeBase = that._sizeFormat(evt.target.result.length);
+            reader.onload = (evt) => {
+                this.resultContent = evt.target.result;
+                this.previewSrc = evt.target.result;
+                this.$refs.panelBox.style.backgroundImage = 'none';
+                this.sizeOri = this._sizeFormat(file.size);
+                this.sizeBase = this._sizeFormat(evt.target.result.length);
             };
             };
             reader.readAsDataURL(file);
             reader.readAsDataURL(file);
         },
         },

部分文件因为文件数量过多而无法显示