Commit b1dd6209 authored by yyh's avatar yyh

banner图大小限制

parent f91cca28
...@@ -86,6 +86,10 @@ export default class AddBanner extends Vue { ...@@ -86,6 +86,10 @@ export default class AddBanner extends Vue {
this.$toast("最多上传4张banner图"); this.$toast("最多上传4张banner图");
return; return;
} }
if (e.target.files[0].size > 2* 1024 * 1024) {
this.$toast("文件大小限制2M");
return;
}
(this.$refs.cropper as any).loadFile(e.target.files[0]); (this.$refs.cropper as any).loadFile(e.target.files[0]);
e.target.value = ''; e.target.value = '';
} }
......
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