skyblued 2 år sedan
förälder
incheckning
7fa2eb8200

+ 14 - 7
src/views/coursewarePlay/component/point.module.less

@@ -1,6 +1,8 @@
 .container {
+  display: flex;
+  flex-direction: column;
   min-width: 217px;
-  min-height: 100vh;
+  height: 100vh;
   color: #fff;
   font-size: 12px;
   box-sizing: border-box;
@@ -9,12 +11,17 @@
   display: flex;
   align-items: center;
   padding: 13px 10px 15px 15px;
+  flex-shrink: 0;
   img {
     width: 16px;
     height: 16px;
     margin-right: 7px;
   }
 }
+.content{
+    flex: 1;
+    overflow-y: auto;
+}
 .collapse {
   &:after {
     display: none;
@@ -56,18 +63,18 @@
   justify-content: space-between;
   padding: 4px 5px;
   border-radius: 6px;
-  :global{
-    .van-icon{
-        display: none;
+  :global {
+    .van-icon {
+      display: none;
     }
   }
 }
 .itemActive {
   background: rgba(0, 0, 0, 0.15);
   color: var(--van-primary);
-  :global{
-    .van-icon{
-        display: block;
+  :global {
+    .van-icon {
+      display: block;
     }
   }
 }

+ 16 - 9
src/views/coursewarePlay/component/points.tsx

@@ -25,16 +25,19 @@ export default defineComponent({
     const pointData = reactive({
       active: props.tabActive || ''
     })
-    watch(() => props.tabActive, () => {
-      pointData.active = props.tabActive
-    })
+    watch(
+      () => props.tabActive,
+      () => {
+        pointData.active = props.tabActive
+      }
+    )
     return () => (
       <div class={styles.container}>
-        <div>
-          <div class={styles.pointHead}>
-            <img src={iconMulv} />
-            课程目录
-          </div>
+        <div class={styles.pointHead}>
+          <img src={iconMulv} />
+          课程目录
+        </div>
+        <div class={styles.content}>
           <Collapse
             class={styles.collapse}
             modelValue={pointData.active}
@@ -58,7 +61,11 @@ export default defineComponent({
                                   props.itemActive == n.id ? styles.itemActive : ''
                                 ]}
                                 onClick={() => {
-                                  emit('handleSelect', { itemActive: n.id, tabActive: item.id, tabName: item.name })
+                                  emit('handleSelect', {
+                                    itemActive: n.id,
+                                    tabActive: item.id,
+                                    tabName: item.name
+                                  })
                                 }}
                               >
                                 {n.name}