江西小程序管理端
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.

38 lines
749 B

1 year 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. &.active {
  29. background: rgba(25,137,250,0.1);
  30. border-radius: 16rpx;
  31. border: 2rpx solid #1989FA;
  32. color: $themC;
  33. font-weight: 600;
  34. }
  35. }
  36. }
  37. </style>