Browse Source

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

花裤衩 6 years ago
parent
commit
e69c2c8afc
1 changed files with 4 additions and 3 deletions
  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 {
58
     }
58
     }
59
   },
59
   },
60
   data() {
60
   data() {
61
-    return {
62
-      onlyOneChild: null
63
-    }
61
+    // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
62
+    // TODO: refactor with render function
63
+    this.onlyOneChild = null
64
+    return {}
64
   },
65
   },
65
   methods: {
66
   methods: {
66
     hasOneShowingChild(children, parent) {
67
     hasOneShowingChild(children, parent) {