base-tabs.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!--
  2. ****--@date 2024-06-10 14:46:00
  3. ****--@author yizhiyang
  4. ****--@description base tabs
  5. -->
  6. <template>
  7. <view class="base-tabs">
  8. <u-tabs
  9. :list="list"
  10. @click="handleClick"
  11. :lineWidth="lineWidth"
  12. lineColor="#215ebe"
  13. :activeStyle="activeStyle"
  14. :inactiveStyle="inactiveStyle"
  15. :itemStyle="itemStyle"
  16. :scrollable="true"
  17. ></u-tabs>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'base-tabs',
  23. props: {
  24. list: {
  25. type: Array,
  26. default: [],
  27. },
  28. height: {
  29. type: String,
  30. default: '88rpx',
  31. },
  32. lineWidth: {
  33. type: Number,
  34. default: 30,
  35. },
  36. paddingLeft: {
  37. type: String,
  38. default: '0px',
  39. },
  40. paddingRight: {
  41. type: String,
  42. default: '0px',
  43. },
  44. },
  45. computed: {
  46. activeStyle() {
  47. return {
  48. color: '#215ebe',
  49. fontWeight: 'bold',
  50. };
  51. },
  52. inactiveStyle() {
  53. return {
  54. color: '#333333',
  55. transform: 'scale(1)',
  56. };
  57. },
  58. itemStyle() {
  59. let { height, paddingLeft, paddingRight } = this;
  60. return {
  61. height,
  62. paddingLeft,
  63. paddingRight,
  64. };
  65. },
  66. },
  67. methods: {
  68. handleClick() {
  69. this.$emit('click');
  70. },
  71. },
  72. };
  73. </script>