use-list-title.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view :class="type == 'round' ? 'padding-lr-sm' : ''">
  3. <!-- 列表标题 -->
  4. <view class="use-list-title dflex-b padding-lr w-full bg-main" :class="type == 'round' ? 'border-radius' : ''" @click="goto">
  5. <view class="dflex">
  6. <view v-if="iconfont && iconfont != ' '" class="iconfont __left margin-right-sm" :class="iconfont" :style="{ color: color }"></view>
  7. <text :style="{fontSize: size + 'rpx', fontWeight: fwt }">{{ title }}</text>
  8. </view>
  9. <view class="dflex">
  10. <text v-if="tip" class="tip margin-right-xs">{{tip}}</text>
  11. <view class="iconfont fs-sm" :class="rightIcon" :style="{ color: rightColor }"></view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. type: {
  20. type: String,
  21. default: 'square'
  22. },
  23. title: {
  24. type: String,
  25. default: '列表标题'
  26. },
  27. size: {
  28. type: String,
  29. default: '28'
  30. },
  31. fwt: {
  32. type: String,
  33. default: 'normal'
  34. },
  35. tip: {
  36. type: [String, Number],
  37. default: ''
  38. },
  39. iconfont: {
  40. type: String,
  41. default: 'icondaifahuo-'
  42. },
  43. color: {
  44. type: String,
  45. default: '#C0C4CC'
  46. },
  47. rightIcon: {
  48. type: String,
  49. default: 'iconjiantou-01'
  50. },
  51. rightColor: {
  52. type: String,
  53. default: '#c0c0c0'
  54. }
  55. },
  56. data() {
  57. return {};
  58. },
  59. methods: {
  60. goto() {
  61. this.$emit('goto', {
  62. type: 'goto'
  63. });
  64. }
  65. }
  66. };
  67. </script>
  68. <style lang="scss">
  69. .use-list-title {
  70. height: 100rpx;
  71. border-radius: 14px;
  72. line-height: 100rpx;
  73. }
  74. .use-list-title {
  75. .__left{
  76. font-size: $font-lg + 8upx;
  77. }
  78. .iconfont {
  79. color: #c0c0c0;
  80. }
  81. .tip {
  82. font-size: $font-sm;
  83. color: #c0c0c0;
  84. }
  85. }
  86. </style>