Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 780 Bytes

README.md

File metadata and controls

48 lines (39 loc) · 780 Bytes

start

npm instart pc-avatar

 #or
  
yarn add pc-avatar

usage

<Avatar
    defaultImg=""  
    defaultImgList={[]} 
    size={60}
    cropConfirm={async preCropPic => {}}
    getFile={async (file: string) => {}}
/>

//------------------------------------------
interface PropsType {
    /**
     * defaultImg, set the default image
     */
    defaultImg: string;
    /**
     * size, set the size of image
     */
    size: number;
    /**
     * getFile, choice the image from defaultImgList
     */
    getFile: (file: string) => void;
    /**
     * cropConfirm, choice the image from upload
     */
    cropConfirm: (preCropPic: string) => void;
    /**
     * defaultImgList, A list of maps available
     */
    defaultImgList: string[];
}