瀏覽代碼

fix chrome 58 样式兼容性

Michael Wang 3 年之前
父節點
當前提交
acbb99b961
共有 2 個文件被更改,包括 12 次插入2 次删除
  1. 8 1
      src/components/SplitPane.vue
  2. 4 1
      src/features/OnlineExam/Examing/QuestionView.vue

+ 8 - 1
src/components/SplitPane.vue

@@ -26,6 +26,12 @@ function dragMove(e: MouseEvent) {
       : container.offsetWidth;
     const dp = position - startPosition;
     state.split = startSplit + ~~((dp / totalSize) * 100);
+    // console.log({
+    //   isVertical,
+    //   totalSize,
+    //   dp,
+    //   split: state.split,
+    // });
   }
 }
 
@@ -65,7 +71,8 @@ function dragEnd() {
 <style scoped>
 .split-pane {
   display: flex;
-  height: 100%;
+  /* 为了chrome58更改,上层需要是flex,这里的高度才能保证是100%的父容器高度 */
+  /* height: 100%; */
   position: relative;
 }
 .split-pane.dragging {

+ 4 - 1
src/features/OnlineExam/Examing/QuestionView.vue

@@ -127,7 +127,10 @@ function toggleSign() {
       />
       <question-index />
     </div>
-    <div v-if="store.exam.currentQuestion.parentBody" class="tw-flex-grow">
+    <div
+      v-if="store.exam.currentQuestion.parentBody"
+      class="tw-flex-grow tw-flex"
+    >
       <SplitPane layout="vertical">
         <template #left>
           <div class="question-view parent-question tw-h-full">