上传图片大小不能超过,尝试结果请设置文章标签
beforeUpload: function(t) {
var e = "image/png" === t.type || "image/jpg" === t.type || "image/gif" === t.type || "image/webp" === t.type || "image/bmp" === t.type || "image/jpeg" === t.type
, n = t.size / 1024 / 1024 < 5;
return n || this.$message.error("上传图片大小不能超过 5MB!"),
e || this.$message.error("上传图片支持.jpg .gif .png .bmp .jpeg .webp格式!"),
e && n
},