tabs.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. box-shadow: rgba(0, 0, 0, 0.18) 0px 2px 4px;
  39. }
  40. /deep/ .uni-scroll-view,
  41. /deep/.u-tabs__wrapper__nav__item {
  42. height: 45px !important;
  43. }
  44. /deep/ .u-tabs__wrapper__nav__item__text {
  45. font-size: 14px !important;
  46. }
  47. /* /deep/ .u-tabs__wrapper__nav__line{
  48. bottom: 0 !important;
  49. } */
  50. </style>