tui-table.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <!--需要固定宽高滚动在页面层使用scroll-view即可-->
  3. <view class="tui-table__box" :style="{
  4. borderTop:borderTop? `${borderWidth} solid ${borderColor}`:'0',
  5. borderLeft:borderLeft? `${borderWidth} solid ${borderColor}`:'0',
  6. borderBottom: borderBottom ? `${borderWidth} solid ${borderColor}` : '0',
  7. borderRight: borderRight ? `${borderWidth} solid ${borderColor}` : '0'
  8. }">
  9. <slot></slot>
  10. </view>
  11. </template>
  12. <script>
  13. //字体/背景等配置
  14. export default {
  15. name: 'tuiTable',
  16. props: {
  17. //border width 不需要border传0即可
  18. borderWidth: {
  19. type: String,
  20. default: '1rpx'
  21. },
  22. //border color
  23. borderColor: {
  24. type: String,
  25. default: '#EAEEF5'
  26. },
  27. //是否需要上边框
  28. borderTop: {
  29. type: Boolean,
  30. default: true
  31. },
  32. //是否需要左边框
  33. borderLeft: {
  34. type: Boolean,
  35. default: true
  36. },
  37. //是否需要下边框
  38. borderBottom: {
  39. type: Boolean,
  40. default: false
  41. },
  42. //是否需要右边框
  43. borderRight: {
  44. type: Boolean,
  45. default: false
  46. }
  47. },
  48. data() {
  49. return {
  50. width: 320
  51. };
  52. },
  53. methods:{
  54. }
  55. };
  56. </script>
  57. <style scoped>
  58. .tui-table__box {
  59. font-size: 0;
  60. box-sizing: border-box;
  61. }
  62. </style>