list-view.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="tui-list-view tui-view-class">
  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. unlined: {
  18. type: String,
  19. default: '' //top,bottom,all
  20. }
  21. }
  22. }
  23. </script>
  24. <style>
  25. .tui-list-title {
  26. width: 100%;
  27. padding: 30upx;
  28. box-sizing: border-box;
  29. font-size: 30upx;
  30. line-height: 30upx;
  31. color: #666;
  32. }
  33. .tui-list-content {
  34. width: 100%;
  35. position: relative;
  36. }
  37. .tui-list-content::before {
  38. content: " ";
  39. position: absolute;
  40. top: -1upx;
  41. right: 0;
  42. left: 0;
  43. border-top: 1upx solid #eaeef1;
  44. -webkit-transform: scaleY(0.5);
  45. transform: scaleY(0.5);
  46. }
  47. .tui-list-content::after {
  48. content: '';
  49. position: absolute;
  50. border-bottom: 1upx solid #eaeef1;
  51. -webkit-transform: scaleY(0.5);
  52. transform: scaleY(0.5);
  53. bottom: 0;
  54. right: 0;
  55. left: 0;
  56. }
  57. .tui-border-top::before {
  58. border-top: 0;
  59. }
  60. .tui-border-bottom::after {
  61. border-bottom: 0;
  62. }
  63. .tui-border-all::after {
  64. border-bottom: 0;
  65. }
  66. .tui-border-all::before {
  67. border-top: 0;
  68. }
  69. </style>