mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-04 05:09:43 +08:00
fix upload docs typo bug
This commit is contained in:
parent
c576d5720a
commit
fdac5519d2
@ -55,7 +55,7 @@
|
|||||||
submitUpload() {
|
submitUpload() {
|
||||||
this.$refs.upload.submit();
|
this.$refs.upload.submit();
|
||||||
},
|
},
|
||||||
handleAvatarScucess(res, file) {
|
handleAvatarSuccess(res, file) {
|
||||||
this.imageUrl = URL.createObjectURL(file.raw);
|
this.imageUrl = URL.createObjectURL(file.raw);
|
||||||
},
|
},
|
||||||
beforeAvatarUpload(file) {
|
beforeAvatarUpload(file) {
|
||||||
@ -123,7 +123,7 @@ Use `before-upload` hook to limit the upload file format and size.
|
|||||||
class="avatar-uploader"
|
class="avatar-uploader"
|
||||||
action="https://jsonplaceholder.typicode.com/posts/"
|
action="https://jsonplaceholder.typicode.com/posts/"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:on-success="handleAvatarScucess"
|
:on-success="handleAvatarSuccess"
|
||||||
:before-upload="beforeAvatarUpload">
|
:before-upload="beforeAvatarUpload">
|
||||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
||||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
<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: {
|
methods: {
|
||||||
handleAvatarScucess(res, file) {
|
handleAvatarSuccess(res, file) {
|
||||||
this.imageUrl = URL.createObjectURL(file.raw);
|
this.imageUrl = URL.createObjectURL(file.raw);
|
||||||
},
|
},
|
||||||
beforeAvatarUpload(file) {
|
beforeAvatarUpload(file) {
|
||||||
@ -308,7 +308,7 @@ You can drag your file to a certain area to upload it.
|
|||||||
:on-preview="handlePreview"
|
:on-preview="handlePreview"
|
||||||
:on-remove="handleRemove"
|
:on-remove="handleRemove"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
mutiple>
|
multiple>
|
||||||
<i class="el-icon-upload"></i>
|
<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__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>
|
<div class="el-upload__tip" slot="tip">jpg/png files with a size less than 500kb</div>
|
||||||
|
@ -95,7 +95,7 @@
|
|||||||
submitUpload() {
|
submitUpload() {
|
||||||
this.$refs.upload.submit();
|
this.$refs.upload.submit();
|
||||||
},
|
},
|
||||||
handleAvatarScucess(res, file) {
|
handleAvatarSuccess(res, file) {
|
||||||
this.imageUrl = URL.createObjectURL(file.raw);
|
this.imageUrl = URL.createObjectURL(file.raw);
|
||||||
},
|
},
|
||||||
beforeAvatarUpload(file) {
|
beforeAvatarUpload(file) {
|
||||||
@ -164,7 +164,7 @@
|
|||||||
class="avatar-uploader"
|
class="avatar-uploader"
|
||||||
action="https://jsonplaceholder.typicode.com/posts/"
|
action="https://jsonplaceholder.typicode.com/posts/"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:on-success="handleAvatarScucess"
|
:on-success="handleAvatarSuccess"
|
||||||
:before-upload="beforeAvatarUpload">
|
:before-upload="beforeAvatarUpload">
|
||||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
||||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
@ -204,7 +204,7 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleAvatarScucess(res, file) {
|
handleAvatarSuccess(res, file) {
|
||||||
this.imageUrl = URL.createObjectURL(file.raw);
|
this.imageUrl = URL.createObjectURL(file.raw);
|
||||||
},
|
},
|
||||||
beforeAvatarUpload(file) {
|
beforeAvatarUpload(file) {
|
||||||
@ -344,7 +344,7 @@
|
|||||||
class="upload-demo"
|
class="upload-demo"
|
||||||
drag
|
drag
|
||||||
action="https://jsonplaceholder.typicode.com/posts/"
|
action="https://jsonplaceholder.typicode.com/posts/"
|
||||||
mutiple>
|
multiple>
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
||||||
|
@ -65,10 +65,8 @@ export default {
|
|||||||
if (postFiles.length === 0) { return; }
|
if (postFiles.length === 0) { return; }
|
||||||
|
|
||||||
postFiles.forEach(rawFile => {
|
postFiles.forEach(rawFile => {
|
||||||
if (!this.thumbnailMode || this.isImage(rawFile.type)) {
|
this.onStart(rawFile);
|
||||||
this.onStart(rawFile);
|
if (this.autoUpload) this.upload(rawFile);
|
||||||
if (this.autoUpload) this.upload(rawFile);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
upload(rawFile, file) {
|
upload(rawFile, file) {
|
||||||
|
Loading…
Reference in New Issue
Block a user