props.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. import { defineProps } from '../../libs/util/props';
  2. import theme from '../../libs/config/theme.js';
  3. export default defineProps('card', {
  4. // 与屏幕两侧是否留空隙
  5. full: {
  6. type: Boolean,
  7. default: false,
  8. },
  9. // 标题
  10. title: {
  11. type: String,
  12. default: '',
  13. },
  14. // 标题颜色
  15. titleColor: {
  16. type: String,
  17. default: theme.mainColor,
  18. },
  19. // 标题字体大小,单位rpx
  20. titleSize: {
  21. type: [Number, String],
  22. default: 15,
  23. },
  24. // 副标题
  25. subTitle: {
  26. type: String,
  27. default: '',
  28. },
  29. // 副标题颜色
  30. subTitleColor: {
  31. type: String,
  32. default: theme.info,
  33. },
  34. // 副标题字体大小,单位rpx
  35. subTitleSize: {
  36. type: [Number, String],
  37. default: 13,
  38. },
  39. // 是否显示外部边框,只对full=false时有效(卡片与边框有空隙时)
  40. border: {
  41. type: Boolean,
  42. default: false,
  43. },
  44. // 用于标识点击了第几个
  45. index: {
  46. type: [Number, String, Object],
  47. default: '',
  48. },
  49. // 用于隔开上下左右的边距,带单位的写法,如:"30rpx 30rpx","20rpx 20rpx 30rpx 30rpx"
  50. margin: {
  51. type: String,
  52. default: '7px',
  53. },
  54. // card卡片的圆角
  55. round: {
  56. type: [Number, String],
  57. default: 8,
  58. },
  59. // 头部自定义样式,对象形式
  60. headStyle: {
  61. type: Object,
  62. default: () => ({}),
  63. },
  64. // 主体自定义样式,对象形式
  65. bodyStyle: {
  66. type: Object,
  67. default: () => ({}),
  68. },
  69. // 底部自定义样式,对象形式
  70. footStyle: {
  71. type: Object,
  72. default: () => ({}),
  73. },
  74. // 头部是否下边框
  75. headBorderBottom: {
  76. type: Boolean,
  77. default: true,
  78. },
  79. // 底部是否有上边框
  80. footBorderTop: {
  81. type: Boolean,
  82. default: true,
  83. },
  84. // 标题左边的缩略图
  85. thumb: {
  86. type: String,
  87. default: '',
  88. },
  89. // 缩略图宽高,单位rpx
  90. thumbWidth: {
  91. type: [String, Number],
  92. default: 30,
  93. },
  94. // 缩略图是否为圆形
  95. thumbCircle: {
  96. type: Boolean,
  97. default: false,
  98. },
  99. // 缩略图圆角值
  100. thumbRadius: {
  101. type: [String, Number],
  102. default: 3,
  103. },
  104. // 给head,body,foot的内边距
  105. padding: {
  106. type: [String, Number],
  107. default: 10,
  108. },
  109. // 是否显示头部
  110. showHead: {
  111. type: Boolean,
  112. default: true,
  113. },
  114. // 是否显示尾部
  115. showFoot: {
  116. type: Boolean,
  117. default: true,
  118. },
  119. // 卡片外围阴影,字符串形式
  120. boxShadow: {
  121. type: String,
  122. default: 'none',
  123. },
  124. });