Commit 2270743b authored by zL's avatar zL

fix:banner图上传图片限制

parent 74dbae4a
......@@ -3034,9 +3034,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001204",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001204.tgz",
"integrity": "sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ==",
"version": "1.0.30001271",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz",
"integrity": "sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA==",
"dev": true
},
"case-sensitive-paths-webpack-plugin": {
......
......@@ -127,7 +127,7 @@ export default {
hashes: [],
ExistingImg: [], //回显需要
t: null,
typeFile: 'file',
typeFile: "file",
};
},
created() {
......@@ -331,6 +331,16 @@ export default {
this.previews.url = "";
this.option.img = " ";
const file = e.target.files[0];
if (!file) {
return;
}
if (file.size > 5242880) {
this.$message({
message: "上传图片大小不可超过5M",
type: "warning",
});
return;
}
if (file) this.option.img = URL.createObjectURL(file);
},
imgLoad(msg) {
......
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