cgreact-core
Version:
未发表!CGReact前端Web研发框架核心包
41 lines (37 loc) • 1.92 kB
text/typescript
/** IconState并无复杂数据结构*/
import {LayoutState} from "./cgreact-type-layout";
type CGReactIconType = string | "layui-icon-loading-circle" | "layui-icon-loading-point" | "layui-icon-face-smile" | "layui-icon-heart-fill" | "layui-icon-heart" | "layui-icon-add-circle-fine";
type CGReactIconState = {
icon?: CGReactIconType | string, //icon的类型,也可以配置图片路径
size?: "small" | "middle" | "large" | number, //icon的大小
color?: "default" | "simple" | "normal" | "warm" | "danger" | "black" | NamedColor | string,//icon的颜色
theme?: "light" | "dark", //背景主题
labelLeft?: string, //左侧文字
labelRight?: string, //右侧文字
labelTop?: string,//顶部文字
labelBottom?: string,//底部文字
}; //默认icon样式类型
export type IconType = CGReactIconType; //导出图标类型
export interface IconState extends CGReactIconState {}
/** ButtonProps在CGReactCompProp的基础上增加button配置*/
type CGReactIconProp = {
data?: CGReactIconState //使用Button数据类型,
layout?: LayoutState //布局数据类型
};//参数类型
export interface IconProps extends CGReactIconProp, LayoutState {}
/**回调函数数据类型*/
export interface IconConfig
{
type: "img" | "icon",//图标生成元素的类型可能时<img>或者<i>
style: "small" | "middle" | "large",//样式类型
icon: string, //unicode编码,如果时icon则标识layui的类名,如果时img则这里是url
size: number, //大小统一为数字,单位px
font: number,//字体大小
color: string,//颜色统一为字符串,十六进制字符串如#ffeeff,
background: string,//背景颜色
height: number,//logo的高度动态计算
labelL: string, //左侧文字
labelR: string,//右侧文字
labelT: string,//顶部文字
labelB: string,//底部文字
}