gui-box-banner.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view
  3. class="grace-box-banner gui-flex gui-rows gui-nowrap"
  4. :style="{
  5. backgroundColor:background,
  6. paddingTop:padding,
  7. paddingBottom:padding,
  8. borderRadius:borderRadius
  9. }">
  10. <view
  11. class="grace-box-items gui-flex gui-rows gui-nowrap gui-align-items-center"
  12. hover-class="gui-tap"
  13. v-for="(item, index) in items"
  14. :key="index"
  15. @tap.stop="taped(index)">
  16. <view
  17. class="gui-flex1">
  18. <view
  19. class="gui-flex gui-rows gui-nowrap gui-justify-content-center gui-align-items-center">
  20. <text
  21. class="gui-block-text"
  22. :style="{
  23. lineHeight:lineHeight,
  24. color:color[0],
  25. fontSize:fontSize[0]
  26. }">{{item[0]}}</text>
  27. <text
  28. class="gui-block-text"
  29. :style="{
  30. color:color[1],
  31. fontSize:fontSize[1],
  32. marginLeft:'5rpx'
  33. }">{{item[1]}}</text>
  34. </view>
  35. <text
  36. class="gui-block-text gui-text-center"
  37. :style="{
  38. color:color[2],
  39. fontSize:fontSize[2]
  40. }">{{item[2]}}</text>
  41. </view>
  42. <view
  43. class="grace-box-line"
  44. :style="{
  45. 'height' : borderHeight,
  46. 'border-right-width': borderWidth,
  47. 'border-right-style': borderStyle,
  48. 'border-right-color': borderColor
  49. }"
  50. v-if="index < items.length - 1"></view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. name : "gui-box-banner",
  57. props : {
  58. items:{
  59. type : Array,
  60. default : function () {
  61. return []
  62. }
  63. },
  64. color:{
  65. type : Array,
  66. default : function () {
  67. return ['#333333', 'rgba(69, 90, 100, 0.5)', 'rgba(69, 90, 100, 0.5)']
  68. }
  69. },
  70. fontSize:{
  71. type : Array,
  72. default : function () {
  73. return ['36rpx', '24rpx', '24rpx']
  74. }
  75. },
  76. background : {
  77. type : String,
  78. default : ''
  79. },
  80. padding:{
  81. type : String,
  82. default : '20rpx'
  83. },
  84. borderRadius:{
  85. type : String,
  86. default : '10rpx'
  87. },
  88. lineHeight:{
  89. type : String,
  90. default : '60rpx'
  91. },
  92. borderColor : {type:String, default:'#F1F1F1'},
  93. borderWidth : {type:String, default:'1px'},
  94. borderStyle : {type:String, default:'solid'},
  95. borderHeight: {type:String, default:'60rpx'}
  96. },
  97. methods:{
  98. taped:function (index) {
  99. this.$emit('taped', index);
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped>
  105. .grace-box-banner{overflow:hidden;}
  106. .grace-box-items{width:100rpx; flex:1;}
  107. .grace-box-line{width:1px; height:50rpx;}
  108. </style>