feat: 🚀 添加悬浮图上传
This commit is contained in:
@@ -73,7 +73,7 @@ const props = withDefaults(defineProps<UploadFileProps>(), {
|
||||
drag: true,
|
||||
disabled: false,
|
||||
fileSize: 5,
|
||||
fileType: () => ["image/jpeg", "image/png", "image/gif"],
|
||||
fileType: () => ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
||||
height: "150px",
|
||||
width: "150px",
|
||||
borderRadius: "8px"
|
||||
@@ -151,7 +151,9 @@ const editImg = () => {
|
||||
* @param rawFile 选择的文件
|
||||
* */
|
||||
const beforeUpload: UploadProps["beforeUpload"] = rawFile => {
|
||||
// console.log(rowFile.type, "=============1111111111");
|
||||
const imgSize = rawFile.size / 1024 / 1024 < props.fileSize;
|
||||
|
||||
const imgType = props.fileType.includes(rawFile.type as File.ImageMimeType);
|
||||
|
||||
if (!imgType)
|
||||
|
||||
@@ -66,7 +66,7 @@ const props = withDefaults(defineProps<UploadFileProps>(), {
|
||||
disabled: false,
|
||||
limit: 9,
|
||||
fileSize: 5,
|
||||
fileType: () => ["image/jpeg", "image/png", "image/gif"],
|
||||
fileType: () => ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
||||
height: "150px",
|
||||
width: "150px",
|
||||
borderRadius: "8px"
|
||||
|
||||
@@ -70,7 +70,11 @@ export const EDIT_FORM_DATA: FormItem[] = [
|
||||
type: "upImg",
|
||||
label: "Banner图片: "
|
||||
},
|
||||
|
||||
{
|
||||
prop: "extra_image",
|
||||
type: "upImg",
|
||||
label: "悬浮图: "
|
||||
},
|
||||
{
|
||||
prop: "banner_id",
|
||||
placeholder: "请选择",
|
||||
@@ -166,7 +170,11 @@ export const EDIT_FORM_DATA1: FormItem[] = [
|
||||
type: "upImg",
|
||||
label: "Banner图片: "
|
||||
},
|
||||
|
||||
// {
|
||||
// prop: "image1",
|
||||
// type: "upImg",
|
||||
// label: "Banner图片1: "
|
||||
// },
|
||||
{
|
||||
prop: "banner_id",
|
||||
placeholder: "请选择",
|
||||
|
||||
Reference in New Issue
Block a user