瀏覽代碼

fix[Sidebar]: fixed infinite loop bug (#289)

花裤衩 6 年之前
父節點
當前提交
e69c2c8afc
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/views/layout/components/Sidebar/SidebarItem.vue

+ 4 - 3
src/views/layout/components/Sidebar/SidebarItem.vue

@@ -58,9 +58,10 @@ export default {
     }
     }
   },
   },
   data() {
   data() {
-    return {
-      onlyOneChild: null
-    }
+    // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
+    // TODO: refactor with render function
+    this.onlyOneChild = null
+    return {}
   },
   },
   methods: {
   methods: {
     hasOneShowingChild(children, parent) {
     hasOneShowingChild(children, parent) {