소스 검색

修改滚动问题

lex 11 달 전
부모
커밋
a905e288c5
1개의 변경된 파일16개의 추가작업 그리고 1개의 파일을 삭제
  1. 16 1
      src/views/prepare-lessons/components/lesson-main/courseware/addCourseware.tsx

+ 16 - 1
src/views/prepare-lessons/components/lesson-main/courseware/addCourseware.tsx

@@ -804,9 +804,24 @@ export default defineComponent({
                     // scrollSensitivity={120}
                     // forceAutoScrollFallback={true}
                     animation={200}
+                    onDrag={(event: any) => {
+                      // 修复滚动超出范围
+                      const container: any = document.querySelector(
+                        '.listContainerWrap .n-scrollbar-container'
+                      );
+                      const sensitivity = 120; // 自定义灵敏度
+                      if (event.clientY < sensitivity) {
+                        container.scrollTop -= 5;
+                      } else if (
+                        window.innerHeight - event.clientY <
+                        sensitivity
+                      ) {
+                        container.scrollTop += 5;
+                      }
+                    }}
                     componentData={{
                       draggable: 'row-nav',
-                      scroll: true,
+                      // scroll: false,
                       itemKey: 'id',
                       tag: 'div',
                       animation: 200,