Parcourir la source

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

花裤衩 il y a 6 ans
Parent
commit
e69c2c8afc
1 fichiers modifiés avec 4 ajouts et 3 suppressions
  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() {
-    return {
-      onlyOneChild: null
-    }
+    // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
+    // TODO: refactor with render function
+    this.onlyOneChild = null
+    return {}
   },
   methods: {
     hasOneShowingChild(children, parent) {