组件/CardItem 卡片项
通用组件

CardItem 卡片项

用于列表/设置页等场景的通用条目:左侧头像/图标,右侧标题信息,支持右侧操作区。

该页面由 AI 迁移生成,请谨慎使用

内容已迁移完成,但仍建议结合源码和人工评审结果使用。

CardItem 卡片项

用于列表/设置页等场景的通用条目:左侧头像/图标,右侧标题信息,支持右侧操作区。

import { ref } from 'vue' const enabled = ref(true)

基础用法

CardItem

示例即将加载...
<template>
  <TxCardItem title="Enable feature" description="Right area supports actions" icon-class="i-carbon-settings">
    <template #right>
      <TxSwitch v-model="enabled" />
      <i class="i-carbon-chevron-right" />
    </template>
  </TxCardItem>
</template>

API

Props

属性名类型默认值说明
rolestring'button'ARIA role(用于 menuitem / option 等语义)
titlestring''标题
subtitlestring''副标题
descriptionstring''描述
iconClassstring''头像区域图标 class
avatarTextstring''头像文本
avatarUrlstring''头像图片 URL
avatarSizenumber36头像尺寸
avatarShape'circle' | 'rounded''circle'头像形状
clickablebooleanfalse可点击
activebooleanfalse激活态
disabledbooleanfalse禁用

Slots

名称说明
avatar自定义左侧头像区域
title自定义标题
subtitle自定义副标题
description自定义描述
right右侧操作区

Events

事件名参数说明
clickMouseEvent点击触发(需 clickable 且非 disabled