Card 卡片

使用指南

在 page.json 中引入组件

  1. "usingComponents": {
  2. "w-card": "wuss-weapp/w-card/index",
  3. }

视频演示

代码演示

  1. <w-pane title="Card" desc="卡片" />
  2. <w-pane desc="Slot" />
  3. <w-card
  4. loading="{{ loading }}"
  5. title="标题"
  6. extra="副标题"
  7. content="内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区"
  8. footer="底部信息"
  9. footer-extra="底部副标题"
  10. />
  11. <view style="margin: 20px 0;" hover-class="none" hover-stop-propagation="false">
  12. <w-cell-group>
  13. <w-cell label="开启loading">
  14. <w-switch color="#ff9900" slot="content" bind:onChange="handleChange" />
  15. </w-cell>
  16. </w-cell-group>
  17. </view>
  18. <w-pane desc="Full" />
  19. <w-card
  20. full
  21. shadow="{{ false }}"
  22. title="标题"
  23. extra="副标题"
  24. content="内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区内容区"
  25. footer="底部信息"
  26. footer-extra="底部副标题"
  27. />
  28. <w-pane desc="Slot" />
  29. <w-card>
  30. <view
  31. slot="title"
  32. class="w-card-title"
  33. hover-class="none"
  34. hover-stop-propagation="false"
  35. >
  36. 标题
  37. </view>
  38. <view
  39. slot="extra"
  40. class="w-card-extra"
  41. hover-class="none"
  42. hover-stop-propagation="false"
  43. >
  44. 副标题
  45. </view>
  46. <view
  47. slot="content"
  48. class="w-card-content"
  49. hover-class="none"
  50. hover-stop-propagation="false"
  51. >
  52. 内容区内容区内容区内容区内容区内容区内容区内容区
  53. </view>
  54. <view
  55. slot="footer"
  56. class="w-card-footer"
  57. hover-class="none"
  58. hover-stop-propagation="false"
  59. >
  60. 底部
  61. </view>
  62. <view
  63. slot="footer-extra"
  64. class="w-card-footer-extra"
  65. hover-class="none"
  66. hover-stop-propagation="false"
  67. >
  68. 底部extra
  69. </view>
  70. </w-card>
data: {
  loading: false,
},
handleChange(e) {
  this.setData({
    loading: e.detail.value,
  })
},

css

API

Attribute 属性

属性 说明 类型 默认值
full 通栏模式 boolean -
title 头部标题 string -
extra 头部副标题 string -
content 内容区信息 string -
footer 底部标题 string -
footerExtra 底部副标题 string -
shadow 开启卡片阴影 boolean true
loading 进入loading模式 boolean false

Event 事件

事件名 说明 参数
onHdClick header被点击回调 -
onBdClick body被点击回调 -

Slot 插槽

| 名称 | 说明 | | content | 内容区信息 | | footer | 底部标题 | | footer-extra | 底部副标题 | | title | 头部标题 | | extra | 头部副标题 |

Class 自定义类名

类名 说明
wuss-class 根节点样式类
wuss-class-hd 头部样式类
wuss-class-bd 内容部样式类
wuss-class-ft 底部样式类