浏览代码

Update hostsFn.ts

ClDaniel1 3 年之前
父节点
当前提交
1d71f869a5
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/common/hostsFn.ts

+ 2 - 2
src/common/hostsFn.ts

@@ -143,7 +143,7 @@ export const switchItemParentIsON = (
       parent.on = on
       parent.on = on
     } else if (parent.children) {
     } else if (parent.children) {
       let parentOn = true
       let parentOn = true
-      parent.children.map((item) => {
+      parent.children.forEach((item) => {
         if (!item.on) {
         if (!item.on) {
           parentOn = false
           parentOn = false
         }
         }
@@ -171,7 +171,7 @@ export const switchFolderChild = (
   }
   }
 
 
   if (item.children) {
   if (item.children) {
-    item.children.map((item) => {
+    item.children.forEach((item) => {
       item.on = on
       item.on = on
       if (item.type == 'folder') {
       if (item.type == 'folder') {
         item = switchFolderChild(item, on)
         item = switchFolderChild(item, on)