Browse Source

Fix the bug in the default expansion of the left menu / 修复左侧菜单默认展开的bug

star7th 4 years ago
parent
commit
5acf864228

+ 5 - 0
web_src/src/components/item/show/show_regular_item/LeftMenu.vue

@@ -149,6 +149,11 @@ export default {
       } else if (item_info.default_cat_id2) {
         that.openeds = [item_info.default_cat_id2, item_info.default_page_id]
       }
+      // 延迟把左侧栏滚动到默认展开的那个页面
+      setTimeout(() => {
+        const element = document.querySelector('#left_page_' + item_info.default_page_id)
+        element.scrollIntoView()
+      }, 1000)
     }
 
     // 如果是大屏幕且存在目录,则把侧边栏调大

+ 1 - 1
web_src/src/components/item/show/show_regular_item/LeftMenuSub.vue

@@ -14,7 +14,7 @@
             :key="page3.page_id"
           >
             <i class="el-icon-document"></i>
-            <span :title="page3.page_title">{{page3.page_title}}</span>
+            <span :title="page3.page_title" :id="'left_page_'+page3.page_id">{{page3.page_title}}</span>
           </el-menu-item>
         </template>