卡片与面板
Card 是基础内容容器。Panel 增加了彩色标题栏,支持折叠、关闭、全屏以及加载时的 block UI 遮罩。Well 是内凹的浅色容器。
Card
Card
vue
<div class="thl-row">
<div class="thl-col-12 thl-col-md-6"><ThlCard title="Card title" subtitle="Subtitle">Card content.<template #actions><ThlButton size="sm" variant="primary">Action</ThlButton></template></ThlCard></div>
<div class="thl-col-12 thl-col-md-6"><ThlCard bordered shadow title="Bordered + shadow">More content.</ThlCard></div>
</div>tsx
<Card title="Card title" subtitle="Subtitle" actions={<Button size="sm" variant="primary">Action</Button>}>
Card content.
</Card>
<Card bordered shadow title="Bordered + shadow">More content.</Card>html
<thl-card title="Card title" subtitle="Subtitle">
<button thlCardActions thl-button size="sm" variant="primary">Action</button>
Card content.
</thl-card>
<thl-card bordered shadow title="Bordered + shadow">More content.</thl-card>Panel
Panel
vue
<div class="thl-row">
<div class="thl-col-12 thl-col-md-6"><ThlPanel title="Info panel" color="info" collapsible dismissible expandable>Collapse, fullscreen or dismiss me.<template #footer>Panel footer</template></ThlPanel></div>
<div class="thl-col-12 thl-col-md-6"><ThlPanel title="Block UI" color="danger" :loading="busy" loading-text="Loading..."><p>Blocks for 1.5s.</p><ThlButton variant="info" @click="block">Block</ThlButton></ThlPanel></div>
</div>tsx
<Panel title="Info panel" color="info" collapsible dismissible expandable footer="Panel footer">
Collapse, fullscreen or dismiss me.
</Panel>
<Panel title="Block UI" color="danger" loading={busy} loadingText={t('common.loading')}>…</Panel>html
<thl-panel title="Info panel" color="info" collapsible dismissible expandable (dismissed)="onDismiss()">
Collapse, fullscreen or dismiss me.
</thl-panel>
<thl-panel title="Block UI" color="danger" [loading]="busy()">…</thl-panel>Well
Well
vue
<div class="thl-row"><div class="thl-col-6"><ThlWell>Default well</ThlWell></div><div class="thl-col-6"><ThlWell size="lg">Large well</ThlWell></div></div>tsx
<Well>Default well</Well>
<Well size="lg">Large well</Well>html
<thl-well>Default well</thl-well>
<thl-well size="lg">Large well</thl-well>API
Card
<ThlCard> · import { ThlCard } from '@thl-ui/vue'
| Prop | 类型 | 默认值 |
|---|---|---|
title | string | — |
subtitle | string | — |
bordered | boolean | — |
shadow | boolean | — |
flush | boolean | — |
插槽: titleactionsmediadefaultfooter
Panel
<ThlPanel> · import { ThlPanel } from '@thl-ui/vue'
| Prop | 类型 | 默认值 |
|---|---|---|
title | string | — |
color | string | — |
collapsible | boolean | — |
collapsed | boolean | — |
dismissible | boolean | — |
loading | boolean | — |
expandable | boolean | — |
loadingText | string | — |
事件: update:collapseddismiss
插槽: titleactionsdefaultfooter
Well
<ThlWell> · import { ThlWell } from '@thl-ui/vue'
| Prop | 类型 | 默认值 |
|---|---|---|
size | string | — |
插槽: default