// 初始化菜單 // res.menu是一個Menu數組 // 在後端建立子菜單 res.menu.push({ text: "", i18n: "子菜單", acl: "", }); let index=res.menu.length-1; res.menu[index].children=[]; res.menu[index].children.push({ text: "導航1", i18n: "menu1", acl: "", link: "/menu1", }); res.menu[index].children.push({ text: "導航2", i18n: "menu2", acl: "", link: "/menu2", }); this.menuService.add(res.menu);