hookehuyr

fix 文件上传控件错误提示优化

......@@ -67,7 +67,7 @@
* @param file_type[Array] 文件上传类型
* @param multiple[Boolean] 文件多选
*/
import { showSuccessToast, showFailToast } from "vant";
import { showSuccessToast, showFailToast, showToast } from "vant";
import _ from "lodash";
import { v4 as uuidv4 } from "uuid";
import { qiniuTokenAPI, qiniuUploadAPI, saveFileAPI } from "@/api/common";
......@@ -107,12 +107,12 @@ const beforeRead = (file) => {
if (fileList.value.length + 1 > props.item.component_props.max_count) {
// 数量限制
flag = false;
showFailToast(`最大上传数量为${props.item.component_props.max_count}`);
showToast(`最大上传数量为${props.item.component_props.max_count}个`);
}
if (file.size > props.item.component_props.max_size) {
// 体积限制
flag = false;
showFailToast(
showToast(
`最大文件体积为${(props.item.component_props.max_size / 1024 / 1024).toFixed(2)}MB`
);
}
......