use-list-title.vue 1.7 KB

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