mycollect.vue 2.7 KB
<template>
  <div class="container">
    <div class="coursenav collectnav flexone">
      <div
        class="coursenavleft"
        :class="selnav == 0 ? 'selactive' : ''"
        :data-id="0"
        @click="selectnav"
      >帖子</div>
      <div
        class="coursenavleft"
        :class="selnav == 1 ? 'selactive' : ''"
        :data-id="1"
        @click="selectnav"
      >课程</div>
      <div
        class="coursenavleft"
        :class="selnav == 2 ? 'selactive' : ''"
        :data-id="2"
        @click="selectnav"
      >活动</div>
    </div>
    <!-- 课程 -->

    <div class="coursebox" v-if="selnav ==1">
      <div class="courseboxitem">
        <div class="coursenameimg">
          <img src="../../../assets/course.png" alt />
        </div>
        <div class="coursetext">
          <div class="coursename">一个月减重20斤,健康减重没有副作用</div>
          <div class="courseteacher">讲师:孙俪</div>
        </div>
      </div>
      <div class="courseboxitem">
        <div class="coursenameimg">
          <img src="../../../assets/course.png" alt />
        </div>
        <div class="coursetext">
          <div class="coursename">一个月减重20斤,健康减重没有副作用</div>
          <div class="courseteacher">讲师:孙俪</div>
        </div>
      </div>
      <div class="courseboxitem">
        <div class="coursenameimg">
          <img src="../../../assets/course.png" alt />
        </div>
        <div class="coursetext">
          <div class="coursename">一个月减重20斤,健康减重没有副作用</div>
          <div class="courseteacher">讲师:孙俪</div>
        </div>
      </div>
      <div class="courseboxitem">
        <div class="coursenameimg">
          <img src="../../../assets/course.png" alt />
        </div>
        <div class="coursetext">
          <div class="coursename">一个月减重20斤,健康减重没有副作用</div>
          <div class="courseteacher">讲师:孙俪</div>
        </div>
      </div>
    </div>

    <!-- 活动 -->
    <div class="activitybox" v-if="selnav ==2">
      <div class="activityimg">
        <img src="../../../assets/spring.png" alt />
      </div>
      <div class="activityimg">
        <img src="../../../assets/spring.png" alt />
      </div>
      <div class="activityimg">
        <img src="../../../assets/spring.png" alt />
      </div>
      <div class="activityimg">
        <img src="../../../assets/spring.png" alt />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      selnav: 0
    }
  },
  methods: {
    selectnav(e) {
      this.selnav = e.currentTarget.dataset.id;
    }
  }
}
</script>

<style scoped>
@import "../../../style/usercenter.css";
</style>