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

66 lines
1.3 KiB

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