这里是使用title(卡片头部插槽)在顶部添加点击事件,如图,在uni-card里包裹<templete>,然后在<templete>中使用title,这样就可以在view中绑定点击事件了。 最后可以参考官网的Slots。
事件: 插槽: 代码: <template> <view> <uni-card title="基础卡片" sub-title="副标题" extra="额外信息" :thumbnail="avatar" @click="onClick" > <text>这是一个带头像和双标题的基础卡片,此示例展示了一个完整的卡片。</text> </uni-card> <view> ...
使用cover 属性设置卡片封面图,或者使用 cover 插槽设置卡片封面图 使用actions 插槽设置卡片操作栏内容,示例样式排版和事件需要自己实现 <uni-card cover="https://www.wenjiangs.com/wp-content/uploads/2022/docimg1/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"> <!-- <image slot='cover' :src="cover...
<uni-cardcover="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"><text>这是一个带封面和操作栏的卡片示例,此示例展示了封面插槽和操作栏插槽的用法。</text><templatev-slot:actions><viewclass="card-actions"><viewclass="card-actions-item"@click="actionsClick('分享')"><uni...