You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
770 B

9 months ago
  1. <template>
  2. <view class="navs">
  3. <view class="nav" @click="changeNav(item.id)" :class="{active: currentNav==item.id}" v-for="(item,index) in navData" :key="index">{{ item.text }}</view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: ['navData', 'currentNav'],
  9. methods: {
  10. changeNav(id) {
  11. this.$emit('changeNav', id)
  12. }
  13. }
  14. }
  15. </script>
  16. <style lang="scss" scoped>
  17. .navs {
  18. display: flex;
  19. width: 100%;
  20. height: 72rpx;
  21. background: #FFFFFF;
  22. border-radius: 16rpx;
  23. .nav {
  24. flex: 1;
  25. text-align: center;
  26. line-height: 72rpx;
  27. color: #ADADAD;
  28. font-size: 28rpx;
  29. &.active {
  30. background: rgba(25,137,250,0.1);
  31. border-radius: 16rpx;
  32. border: 2rpx solid #1989FA;
  33. color: $themC;
  34. font-weight: 600;
  35. }
  36. }
  37. }
  38. </style>