forked from Antabot/White-Jotter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Antabot#1 from Antabot/dev
Merge
- Loading branch information
Showing
12 changed files
with
170 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<el-upload | ||
class="img-upload" | ||
ref="upload" | ||
action="http://localhost:8443/api/covers" | ||
:on-preview="handlePreview" | ||
:on-remove="handleRemove" | ||
:before-remove="beforeRemove" | ||
:on-success="handleSuccess" | ||
multiple | ||
:limit="1" | ||
:on-exceed="handleExceed" | ||
:file-list="fileList"> | ||
<el-button size="small" type="primary">点击上传</el-button> | ||
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> | ||
</el-upload> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ImgUpload', | ||
data () { | ||
return { | ||
fileList: [], | ||
url: '' | ||
} | ||
}, | ||
methods: { | ||
handleRemove (file, fileList) { | ||
console.log(file, fileList) | ||
}, | ||
handlePreview (file) { | ||
console.log(file) | ||
// 此处的 file 是整个文件 | ||
// console.log(file.response) | ||
}, | ||
handleExceed (files, fileList) { | ||
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`) | ||
}, | ||
beforeRemove (file, fileList) { | ||
return this.$confirm(`确定移除 ${file.name}?`) | ||
}, | ||
handleSuccess (response) { | ||
this.url = response | ||
// console.log(this.url) | ||
this.$emit('onUpload') | ||
this.$message.warning('上传成功') | ||
}, | ||
clear () { | ||
this.$refs.upload.clearFiles() | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.img-upload { | ||
/*height: 200px;*/ | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>白卷 - White Jotter</title><link href=/static/css/app.daf84395f98af98e2b54b8f49180f33e.css rel=stylesheet></head><body style="background: #f6f6f6"><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.578a67f45ff71504b68d.js></script><script type=text/javascript src=/static/js/app.0d870db5dc0ca2694c6a.js></script></body></html> | ||
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>白卷 - White Jotter</title><link href=/static/css/app.dc32149923d2eba22d5855d7ada511b1.css rel=stylesheet></head><body style="background: #f6f6f6"><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.578a67f45ff71504b68d.js></script><script type=text/javascript src=/static/js/app.633e822534ffa18fcf67.js></script></body></html> |
Oops, something went wrong.