Commit 05b20c01 authored by miaojiale's avatar miaojiale

增加限制

parent 7bba16da
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
type: Number, type: Number,
default: 9, default: 9,
}, },
fileSize: Number, fileSize: { type: Number, default: 10 * 1024 * 1024 },
loadText: String, loadText: String,
showFileList: { showFileList: {
type: Boolean, type: Boolean,
...@@ -186,8 +186,9 @@ export default { ...@@ -186,8 +186,9 @@ export default {
beforeUpload(file) { beforeUpload(file) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const size = this.fileSize const size = this.fileSize
console.log(file.size)
if (size && file.size > size) { if (size && file.size > size) {
this.$message.error("大小超出限制" + this.tip) this.$message.error("文件大小超出限制,请上传10M以下的文件")
reject() reject()
} }
resolve() resolve()
...@@ -213,7 +214,7 @@ export default { ...@@ -213,7 +214,7 @@ export default {
// 移除提醒 // 移除提醒
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.file_name || file.name}?`) // return this.$confirm(`确定移除 ${file.file_name || file.name}?`)
}, },
// 移除 // 移除
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment