tui-list-view.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="tui-list-view tui-view-class" :style="{backgroundColor:backgroundColor}">
  3. <view class="tui-list-title" v-if="title">{{title}}</view>
  4. <view class="tui-list-content" :class="[unlined?'tui-border-'+unlined:'']">
  5. <slot></slot>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: "tuiListView",
  12. props: {
  13. title: {
  14. type: String,
  15. default: ''
  16. },
  17. backgroundColor:{
  18. type: String,
  19. default: 'transparent'
  20. },
  21. unlined: {
  22. type: String,
  23. default: '' //top,bottom,all
  24. }
  25. }
  26. }
  27. </script>
  28. <style scoped>
  29. .tui-list-title {
  30. width: 100%;
  31. padding: 30rpx;
  32. box-sizing: border-box;
  33. font-size: 30rpx;
  34. line-height: 30rpx;
  35. color: #666;
  36. }
  37. .tui-list-content {
  38. width: 100%;
  39. position: relative;
  40. }
  41. .tui-list-content::before {
  42. content: " ";
  43. position: absolute;
  44. top: 0;
  45. right: 0;
  46. left: 0;
  47. border-top: 1rpx solid #eaeef1;
  48. -webkit-transform: scaleY(0.5) translateZ(0);
  49. transform: scaleY(0.5) translateZ(0);
  50. transform-origin: 0 0;
  51. z-index: 2;
  52. pointer-events: none;
  53. }
  54. .tui-list-content::after {
  55. content: '';
  56. width: 100%;
  57. position: absolute;
  58. border-bottom: 1rpx solid #eaeef1;
  59. -webkit-transform: scaleY(0.5) translateZ(0);
  60. transform: scaleY(0.5) translateZ(0);
  61. transform-origin: 0 100%;
  62. bottom: 0;
  63. right: 0;
  64. left: 0;
  65. }
  66. .tui-border-top::before {
  67. border-top: 0;
  68. }
  69. .tui-border-bottom::after {
  70. border-bottom: 0;
  71. }
  72. .tui-border-all::after {
  73. border-bottom: 0;
  74. }
  75. .tui-border-all::before {
  76. border-top: 0;
  77. }
  78. </style>