1.0.19 • Published 5 years ago

abc-generals v1.0.19

Weekly downloads
3
License
-
Repository
-
Last release
5 years ago

Generals 统一UI组件

各种小的控件集合,各种提醒文字可配置

适用范围

适合需要小控件的场景,下图为各组件效果截图:

组件效果截图-空状态 组件效果截图-loading状态 组件效果截图-倒计时 组件效果截图-文本自动省略

设计规范链接:https://pro.modao.cc/app/rYK4HcqD68sJYYZWHCWyO5PuDbgF2UJ#screen=s6878562d54154285551100

代码演示

import { NoAddGroup,NoAct,NoFindReport,StocksOfEmpty,NetWorkError,Empty,Loading,CountDown,Ellipsis } from 'abc-generals';

<Empty />
<NetWordError />
<StocksOfEmpty />
<NoFindReport />
<NoAct />
<NoAddGroup />
<Loading />
<CountDown style={{ fontSize: 20 }} target={targetTime} />
<Ellipsis length={100}>{article}</Ellipsis>

API

空状态

参数说明类型默认值
title提示文字,可配置string/element
theme主题string浅色主题
img图片element浅色默认图片

ps:img属性可自定义大小间距等样式,如不需要自定义样式 可直接引用如下示例

const Img = styled.img`
    margin: 0 auto;
    display:block;
    width: 129px;
    height:99px;
`
<Empty img={<Img src={require("../EmptyComponent/Empty/empty-dark.png")} alt="empty" />}/>

loading状态

参数说明类型默认值
title提示文字,可配置string/element
color颜色string灰色
type类型number波浪形

CountDown倒计时

参数说明类型默认值
format时间格式化显示Function(time)
target目标时间Date-
onEnd倒计时结束回调function-

文本自动省略Ellipsis

参数说明类型默认值
tooltip移动到文本展示完整内容的提示boolean-
length在按照长度截取下的文本最大字符数,超过则截取省略number-
lines在按照行数截取下最大的行数,超过则截取省略number1
fullWidthRecognition是否将全角字符的长度视为2来计算字符串长度boolean-