tiefen_space_h5/components/UploadImgs/index.js

24 lines
721 B
JavaScript

import React, { useState } from "react";
import {ImageUploader,Toast} from "antd-mobile";
export default function UploadImgs(props) {
const maxCount = 6;
const [fileList, setFileList] = useState([
]);
return (
<ImageUploader
value={fileList}
onChange={setFileList}
// upload={mockUpload}
multiple
maxCount={9}
showUpload={fileList.length < maxCount}
onCountExceed={(exceed) => {
Toast.show(`最多选择 ${maxCount} 张图片,你多选了 ${exceed}`);
}}
>
<div className="flex justify-center items-center h-[80px] w-[80px] border-2 border-gray-400 border-dashed rounded-md text-2xl text-gray-400">+</div>
</ImageUploader>
);
}