tabs.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view v-if="tabs.length" class="tabs-box">
  3. <u-tabs :list="tabs" @change="onChangeTab" lineColor="#052E5D"
  4. :activeStyle="{ color: '#052E5D', fontWeight: 'bold' }" :inactiveStyle="{
  5. color: '#BBBBBB', fontWeight: 'bold'
  6. }" lineWidth="56" />
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: "tabs",
  12. props: {
  13. tabs: Array,
  14. current: {
  15. type: Number || String,
  16. default: 0
  17. },
  18. changeTab: Function
  19. },
  20. data() {
  21. return {
  22. }
  23. },
  24. methods: {
  25. onChangeTab(e) {
  26. this.$emit("changeTab", e)
  27. }
  28. }
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .tabs-box {
  33. width: 355px;
  34. height: 45px;
  35. border-radius: 4px;
  36. background: #fff;
  37. margin: 15px auto 0;
  38. }
  39. /deep/ .uni-scroll-view,
  40. /deep/.u-tabs__wrapper__nav__item {
  41. height: 45px !important;
  42. }
  43. /deep/ .u-tabs__wrapper__nav__item__text {
  44. font-size: 14px !important;
  45. }
  46. /* /deep/ .u-tabs__wrapper__nav__line{
  47. bottom: 0 !important;
  48. } */
  49. </style>