瀏覽代碼

获取菜单

panxingxin 5 年之前
父節點
當前提交
9dd04d44b6
共有 1 個文件被更改,包括 6 次插入7 次删除
  1. 6 7
      pages/home/home.js

+ 6 - 7
pages/home/home.js

@@ -17,13 +17,12 @@ Page({
       requestAPI.getMenu().then(res=>{
         let tempList = []
         if(res&&res.data&&res.data.data) {
-          // for(let i of res.data.data) {
-            // let filterList = menuList.filter(item => {
-            //   return item.name === i.name
-            // })
-            // tempList = tempList.concat(filterList)
-          // }
-          tempList = menuList
+          for(let i of res.data.data) {
+            let filterList = menuList.filter(item => {
+              return item.name === i.name
+            })
+            tempList = tempList.concat(filterList)
+          }
           this.setData({
             menuList: tempList,
             isLogin: true