Kaynağa Gözat

fix upload docs typo bug

baiyaaaaa 8 yıl önce
ebeveyn
işleme
fdac5519d2

+ 4 - 4
examples/docs/en-US/upload.md

@@ -55,7 +55,7 @@
       submitUpload() {
         this.$refs.upload.submit();
       },
-      handleAvatarScucess(res, file) {
+      handleAvatarSuccess(res, file) {
         this.imageUrl = URL.createObjectURL(file.raw);
       },
       beforeAvatarUpload(file) {
@@ -123,7 +123,7 @@ Use `before-upload` hook to limit the upload file format and size.
   class="avatar-uploader"
   action="https://jsonplaceholder.typicode.com/posts/"
   :show-file-list="false"
-  :on-success="handleAvatarScucess"
+  :on-success="handleAvatarSuccess"
   :before-upload="beforeAvatarUpload">
   <img v-if="imageUrl" :src="imageUrl" class="avatar">
   <i v-else class="el-icon-plus avatar-uploader-icon"></i>
@@ -163,7 +163,7 @@ Use `before-upload` hook to limit the upload file format and size.
       };
     },
     methods: {
-      handleAvatarScucess(res, file) {
+      handleAvatarSuccess(res, file) {
         this.imageUrl = URL.createObjectURL(file.raw);
       },
       beforeAvatarUpload(file) {
@@ -308,7 +308,7 @@ You can drag your file to a certain area to upload it.
   :on-preview="handlePreview"
   :on-remove="handleRemove"
   :file-list="fileList"
-  mutiple>
+  multiple>
   <i class="el-icon-upload"></i>
   <div class="el-upload__text">Drop file here or <em>click to upload</em></div>
   <div class="el-upload__tip" slot="tip">jpg/png files with a size less than 500kb</div>

+ 4 - 4
examples/docs/zh-CN/upload.md

@@ -95,7 +95,7 @@
       submitUpload() {
         this.$refs.upload.submit();
       },
-      handleAvatarScucess(res, file) {
+      handleAvatarSuccess(res, file) {
         this.imageUrl = URL.createObjectURL(file.raw);
       },
       beforeAvatarUpload(file) {
@@ -164,7 +164,7 @@
   class="avatar-uploader"
   action="https://jsonplaceholder.typicode.com/posts/"
   :show-file-list="false"
-  :on-success="handleAvatarScucess"
+  :on-success="handleAvatarSuccess"
   :before-upload="beforeAvatarUpload">
   <img v-if="imageUrl" :src="imageUrl" class="avatar">
   <i v-else class="el-icon-plus avatar-uploader-icon"></i>
@@ -204,7 +204,7 @@
       };
     },
     methods: {
-      handleAvatarScucess(res, file) {
+      handleAvatarSuccess(res, file) {
         this.imageUrl = URL.createObjectURL(file.raw);
       },
       beforeAvatarUpload(file) {
@@ -344,7 +344,7 @@
   class="upload-demo"
   drag
   action="https://jsonplaceholder.typicode.com/posts/"
-  mutiple>
+  multiple>
   <i class="el-icon-upload"></i>
   <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
   <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>

+ 2 - 4
packages/upload/src/upload.vue

@@ -65,10 +65,8 @@ export default {
       if (postFiles.length === 0) { return; }
 
       postFiles.forEach(rawFile => {
-        if (!this.thumbnailMode || this.isImage(rawFile.type)) {
-          this.onStart(rawFile);
-          if (this.autoUpload) this.upload(rawFile);
-        }
+        this.onStart(rawFile);
+        if (this.autoUpload) this.upload(rawFile);
       });
     },
     upload(rawFile, file) {