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

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