学员端小程序
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.

65 lines
1.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="navBox">
  4. <view class="nav" v-for="(item,index) in navList" :key="index" @click="changeNav(item)" :class="{active: currentNav==item.id}">{{ item.text }}</view>
  5. </view>
  6. <view class="card">
  7. <commentItem/>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. // import commentItem from './commentItem'
  13. export default {
  14. // components: { commentItem },
  15. data() {
  16. return {
  17. navList: [
  18. {text: '全部', id: 1},
  19. {text: '最新', id: 2},
  20. {text: '有图22', id: 3},
  21. {text: '有视频', id: 4},
  22. ],
  23. currentNav: 1,
  24. }
  25. },
  26. methods: {
  27. changeNav(item) {
  28. this.currentNav = item.id
  29. }
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .pageBg {
  35. width: 100%;
  36. min-height: 100vh;
  37. padding: 0 28rpx;
  38. .navBox {
  39. padding: 32rpx 0 24rpx 0;
  40. display: flex;
  41. .nav {
  42. padding: 10rpx 24rpx;
  43. height: 60rpx;
  44. background: rgba(25,137,250,0.1);
  45. border-radius: 8rpx;
  46. border: 2rpx solid #1989FA;
  47. font-size: 28rpx;
  48. color: $themC;
  49. margin-right: 20rpx;
  50. text-align: center;
  51. &.active {
  52. color: #fff;
  53. background: $themC;
  54. }
  55. }
  56. }
  57. .card {
  58. width: 100%;
  59. padding: 24rpx 28rpx;
  60. margin-bottom: 20rpx;
  61. }
  62. }
  63. </style>