empty-component(无数据显示)使用说明
项目运行
-
cnpm install 或 npm install cnpm使用教程
-
npm run dev (开发环境打包 port:8080)
-
npm run test (测试用例)
-
npm run build (生产环境打包)
empty-component参数
{
ContainerHeight: 444, //外界容器高度,默认宽度为150px
ContainerWidth: 222 //外界容器宽度
}
empty-component使用方法
1.安装npm组件包
npm install @beisen/empty-component --save-dev
2.引用组件
import EmptyComponent from './src/index.js';
3.传入参数
该参数为上述参数,传入方式使用props传入,如果不传入默认高度为150px。
class Demo extends Component {
constructor() {
super();
this.state = {
ContainerHeight: 444, //外界容器高度,默认宽度150px
ContainerWidth: 222 //外界容器宽度
}
}
render() {
return (
<div>
<EmptyComponent {...this.state}/>
</div>
)
}
}
render(<Demo />, document.getElementById('content'))
Beisen-module-template
没有数据时使用该组件展示
使用
import Empty from '@beisen-cmps/empty'
<Empty />
API
属性 | 描述 | 类型 | 默认值 |
---|---|---|---|
ContainerHeight | 容器高度 | number | 150 |
ContainerWidth | 容器宽度 | number | - |