Card 卡片
一张卡片
示例
各种例子
<template>
<PreviewBlock title="最简例子" :show-section="false">
<DuCard title="商城" subtitle="66个在卖">
内容
</DuCard>
</PreviewBlock>
<PreviewBlock title="显示说明按钮" :show-section="false">
<DuCard title="商城" subtitle="66个在卖" info-text="规格说明">
内容
</DuCard>
</PreviewBlock>
<PreviewBlock title="展示 Action 图标" :show-section="false">
<DuCard title="标题" subtitle="子标题" info-text="" guide-text="" action-icon="delete">
内容
</DuCard>
</PreviewBlock>
<PreviewBlock title="自定义右侧 Slot" :show-section="false">
<DuCard title="款式">
<template #right>
<DuButton size="mini" type="outline" color="default">我拥有的 8</DuButton>
</template>
<div>内容</div>
</DuCard>
</PreviewBlock>
<PreviewBlock title="自定义左侧 Slot" :show-section="false">
<DuCard title="款式" guide-text="查看所有">
<template #left>
<DuButton size="mini" type="outline" color="default">我拥有的 8</DuButton>
</template>
<div>内容</div>
</DuCard>
</PreviewBlock>
<PreviewBlock title="展开/折叠" :show-section="false">
<DuCard title="款式" guide-text="查看所有" mode="collapse" :default-open="false">
<template #left>
<DuButton size="mini" type="outline" color="default">我拥有的 8</DuButton>
</template>
<div>内容</div>
</DuCard>
</PreviewBlock>
</template>
<script lang="ts" setup>
import { DuButton, DuCard } from 'dangoui'
</script>
0
API
属性
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
open | boolean | null | null | |
ext-class | string | string[] | Record<string, boolean> | "" | |
ext-style | string | { [x: string]: string | number; } | "" | |
size | "normal" | "large" | "normal" | |
title | string | "" | |
subtitle | string | "" | |
guide-text | string | "\u67E5\u770B\u66F4\u591A" | |
info-text | string | "" | |
action-icon | string | "" | |
mode | "normal" | "collapse" | "normal" | |
default-open | boolean | null | null | |
content-style | string | { [x: string]: string | number; } | "" | |
show-header | boolean | true |
插槽
名称 |
---|
left |
right |
default |
事件
名称 | 类型 |
---|---|
guideTap | (event: "guideTap"): void |
infoTap | (event: "infoTap"): void |
actionTap | (event: "actionTap"): void |
toggleOpen | (event: "toggleOpen", open: boolean): void |