index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="collection-box">
  3. <view class="header">
  4. <view class="title">
  5. <span :class="{ active: isType == 0 }" @click="isType = 0">做错题</span>
  6. <span :class="{ active: isType == 1 }" @click="isType = 1">收藏题</span>
  7. </view>
  8. </view>
  9. <swiper :current="isType" :duration="500">
  10. <swiper-item>
  11. <scroll-view :scroll-y="true"> </scroll-view>
  12. </swiper-item>
  13. <swiper-item>
  14. <scroll-view :scroll-y="true"> </scroll-view>
  15. </swiper-item>
  16. </swiper>
  17. </div>
  18. </template>
  19. <script >
  20. export default {
  21. data() {
  22. return {
  23. isType: 0,
  24. };
  25. },
  26. methods: {
  27. onClickLeft() {},
  28. },
  29. components: {},
  30. };
  31. </script>
  32. <style lang="scss" scoped>
  33. .collection-box {
  34. height: 100vh;
  35. display: flex;
  36. flex-direction: column;
  37. background: #fff;
  38. }
  39. .header {
  40. width: 100%;
  41. border-bottom: 2rpx solid #dddddd;
  42. padding-bottom: 15rpx;
  43. .title {
  44. display: flex;
  45. width: 260rpx;
  46. margin: 0 auto;
  47. justify-content: space-between;
  48. align-items: center;
  49. span {
  50. font-size: 15px;
  51. font-family: PingFang SC;
  52. font-weight: 400;
  53. line-height: 13px;
  54. color: #0a1a33;
  55. position: relative;
  56. padding: 8px;
  57. }
  58. .active {
  59. &:after {
  60. position: absolute;
  61. content: "";
  62. width: 20px;
  63. height: 4px;
  64. border-radius: 3px;
  65. background-color: #498ef5;
  66. bottom: 0;
  67. left: 50%;
  68. transform: translateX(-50%);
  69. z-index: 100;
  70. }
  71. }
  72. }
  73. }
  74. </style>