Skip to content

This is a avatar component written with TypeScript

License

Notifications You must be signed in to change notification settings

howyea/pc-avatar

Repository files navigation

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[];
}

About

This is a avatar component written with TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published