提交 610aa59c 编写于 作者: haochangdi's avatar haochangdi

修改上传图片大小的提示

上级 8f4470bd
......@@ -450,10 +450,6 @@ export default {
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (file.width != fileLimit.width || file.height != fileLimit.height) {
vm.$message.error("图片不符合规范,请根据规范上传图片");
return;
}
if (!isJPG && !isPNG) {
vm.$message.error("图片不符合规范,请根据规范上传图片");
return;
......@@ -468,10 +464,10 @@ export default {
let image = new Image();
image.src = theFile.target.result;
image.onload = function() {
let _vm = vm;
if ( false
// _vm.width != fileLimit.width ||
// _vm.height != fileLimit.height
let _vm = this;
if (
_vm.width != fileLimit.width ||
_vm.height != fileLimit.height
) {
vm.$message.error("图片不符合规范,请根据规范上传图片");
} else {
......
......@@ -463,10 +463,6 @@ export default {
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (file.width != fileLimit.width || file.height != fileLimit.height) {
vm.$message.error("图片不符合规范,请根据规范上传图片");
return;
}
if (!isJPG && !isPNG) {
vm.$message.error("图片不符合规范,请根据规范上传图片");
return;
......@@ -481,10 +477,10 @@ export default {
let image = new Image();
image.src = theFile.target.result;
image.onload = function() {
let _vm = vm;
if ( false
// _vm.width != fileLimit.width ||
// _vm.height != fileLimit.height
let _vm = this;
if (
_vm.width != fileLimit.width ||
_vm.height != fileLimit.height
) {
vm.$message.error("图片不符合规范,请根据规范上传图片");
} else {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册