JSPM

  • Created
  • Published
  • Downloads 101
  • Score
    100M100P100Q94354F
  • License MIT

Empty component

Package Exports

  • @uiw/react-empty
  • @uiw/react-empty/cjs/index.js
  • @uiw/react-empty/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@uiw/react-empty) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Empty 空状态

Open in unpkg NPM Downloads npm version

空状态时的展示占位图。新组件 v4.11.0+ 支持。

import { Empty } from 'uiw';
// or
import Empty from '@uiw/react-empty';

基本使用

import ReactDOM from 'react-dom';
import { Empty, Button } from 'uiw';

ReactDOM.render(<Empty />, _mount_);

自定义

通过自定义属性定制个性化展示。

import ReactDOM from 'react-dom';
import { Empty, Icon } from 'uiw';

const Demo = () => {
  return(
    <Empty
      description={
        <span>
          Customize <a href="#">Description</a>
        </span>
      }
      icon={<Icon type="shopping-cart"  style={{ fontSize: '39px' }} />}
    >
      <Button type="primary">新增数据</Button>
    </Empty>
  )
}

ReactDOM.render(<Demo />, _mount_);

无描述展示

import ReactDOM from 'react-dom';
import { Empty, Button } from 'uiw';

ReactDOM.render(<Empty description={false} />, _mount_);

Props

参数 说明 类型 默认值
description 自定义描述内容 ReactNode 暂无数据
icon 可以替换内置图标 ReactNode -
size 内置 svg 图标:尺寸 number | string -
iconProps 内置 svg 图标:属性设置 React.SVGProps<SVGSVGElement> -