🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

lofter-components

Package Overview
Dependencies
Maintainers
9
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lofter-components

lofter通用业务组件

latest
npmnpm
Version
1.0.2
Version published
Maintainers
9
Created
Source

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

FAQs

Package last updated on 15 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts