Appearance
Exhibit 光座
图标坐在椭圆光座上。光晕结构来自蓝、红两套底座,颜色可以换成下面任意一档,也可以直接写色值。默认带呼吸光晕、底座涟漪和图标轻浮;:animated="false" 可关掉。
基础用法
告警用红,安全用蓝。两条指标并排坐在深色圆角条里:光座在左,数值和名称在右。单位跟在数值后面,字号缩小,仍是白色。
vue
<div class="safety-strip">
<div>
<CkExhibit color="red" icon="alarm-warning" label="未处理告警" />
<p>
<strong>8</strong>
<span>未处理告警</span>
</p>
</div>
<div>
<CkExhibit color="blue" icon="shield-check" label="安全运行" />
<p>
<strong>365<em>天</em></strong>
<span>安全运行</span>
</p>
</div>
</div>css
.safety-strip {
display: flex;
align-items: center;
gap: 56px;
width: max-content;
padding: 18px 24px 18px 16px;
border-radius: 8px;
background: #041d2e;
}
.safety-strip > div {
display: flex;
align-items: center;
gap: 8px;
}
.safety-strip p {
margin: 0;
}
.safety-strip strong {
display: block;
color: #fff;
font-family: var(--cockpit-font-number);
font-size: 32px;
font-weight: 700;
line-height: 1;
}
.safety-strip em {
margin-left: 2px;
color: #fff;
font-size: 14px;
font-style: normal;
font-weight: 400;
}
.safety-strip span {
display: block;
margin-top: 6px;
color: #9aabb8;
font-size: 12px;
line-height: 16px;
}颜色
十档预设。蓝、红与资料里的底座一致,其余沿用同一套光晕。
蓝
青
蓝绿
绿
黄
金
橙
红
品红
紫
vue
<CkExhibit color="cyan" icon="signal-wifi" />
<CkExhibit color="green" icon="checkbox-circle" />
<CkExhibit color="gold" icon="certificate" />
<CkExhibit color="magenta" icon="temp-hot" />
<CkExhibit color="purple" icon="shield-keyhole" />color 也可以写色值,光座和图标一起跟着变。
vue
<CkExhibit color="#7C5CFF" icon="dashboard" />尺寸
small、default、large,或直接写像素。
vue
<CkExhibit color="orange" icon="fire" size="small" />
<CkExhibit color="orange" icon="fire" />
<CkExhibit color="orange" icon="fire" size="large" />默认插槽可以换掉图标。
vue
<CkExhibit color="cyan">
<span>24</span>
</CkExhibit>API
Exhibit
| 属性 | 说明 | 类型 | 默认 |
|---|---|---|---|
| color | 光座颜色。预设名或 CSS 颜色 | ExhibitColor | string | 'blue' |
| icon | 图标名 | string | — |
| theme | 图标风格 | 'outlined' | 'filled' | 'filled' |
| size | 边长 | 'small' | 'default' | 'large' | number | 'default' |
| animated | 呼吸光晕与图标轻浮 | boolean | true |
| label | 读屏文案。不传时当作装饰 | string | — |
ExhibitColor:blue cyan teal green yellow gold orange red magenta purple。
| 颜色 | 色值 |
|---|---|
| blue | #0095FF |
| cyan | #00FFEE |
| teal | #14C8C8 |
| green | #2CE33B |
| yellow | #FFE600 |
| gold | #E39B12 |
| orange | #EF7D31 |
| red | #E32C2D |
| magenta | #FF4D8A |
| purple | #A855F7 |