lofter-components
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

lofter-components

开发前置工作

  • image-upload
  • video-upload

以上接口依赖微前端node转发,调试的时候需要配置微前端测试环境域名

127.0.0.1 tlofter.hz.netease.com

图片上传


declare type BeforeUploadValueType = void | boolean | string | Blob | File;
interface Props {
  /**
   * 额外描述
   */
  hint?: string;
  /**
   * 图片url地址
   */
  value?: string;
  /**
   * 上传更改回调
   */
  beforeUpload?: (file: {
     file: RcFile,
     width: number,
     height: number
   }, FileList: RcFile[]) => BeforeUploadValueType | Promise<BeforeUploadValueType>;
  /**
   * 接收图片的类型,默认image/*
   */
  accept?: string;
  /**
   * 上传接口前缀,用于微前端,默认/api/imgUpload
   */
  prefix?: boolean;
}

视频上传

interface Props {
  /**
   * 额外描述
   */
  hint?: string;
   /**
   * 视频url地址
   */
  value?: string;
   /**
   * 上传更改回调
   */
  onChange?: (value: string) => void;
   /**
   * 接收图片的类型,默认image/*
   */
  accept?: string;
   /**
   * 上传接口前缀,用于微前端,默认/api/imgUpload
   */
  prefix?: boolean;
  /**
   * 上传前的校验函数
   */
  beforeUpload?: (file: File) => void;
}

Readme

Keywords

none

Package Sidebar

Install

npm i lofter-components

Weekly Downloads

3

Version

1.0.2

License

ISC

Unpacked Size

65.4 kB

Total Files

26

Last publish

Collaborators

  • luofeiyue
  • whiskeyi
  • yousy
  • guoyeeg
  • azgaga
  • liushichuan
  • yaochen
  • shenyuan
  • aflyermin
  • ignous
  • jeekdong