Card 卡片

使用指南

  • 确保 components 下引入 behavors/router.js, icon、card组件
  • 在 app.json 或 index.json 中引入组件

{
  "usingComponents": {
    "fs-card": "path/components/card/index",
  }
}
1
2
3
4
5
6

代码演示

  • 带图片
<fs-card
  title="卡片标题"
  sub-title="小标题"
  img="https://dummyimage.com/50x50/509292/fff"
  circle />
1
2
3
4
5
  • 带说明
<fs-card
  title="100元代金券"
  sub-title="小标题"
  img="https://dummyimage.com/50x50/509292/fff"
  append="483米有门店" />
1
2
3
4
5
  • 说明内容自定义
<fs-card
  title="100元代金券"
  sub-title="小标题"
  img="https://dummyimage.com/50x50/509292/fff"
  class="card-demo"
  >
  <view class="card-append">
    <fs-icon name="view" />
    查看门店
  </view>
</fs-card>
1
2
3
4
5
6
7
8
9
10
11
  • 内链跳转
<fs-card
  title="内链跳转"
  sub-title="副标题非必填"
  to="/pages/cell/index"
  class="card-demo" />
1
2
3
4
5

属性

参数 说明 类型 默认值
custom-class 外部样式 String -
title 主标题 String -
sub-title 小标题 String -
img 图片地址(可选) String -
circle 图片圆形 Boolean -
append 附加信息 String -
to 内部跳转链接 String -

插槽

插槽名 说明
append 自定义append内容

事件

event 说明 返回值
click 点击 event