为路由添加数据
this.$router.addRoutes(menuDataResolve);
后端返回的数据格式
{ "id": 1, "name": "列表", "type": 3, "resKey": "list", "path": "/list", "children": [ { "id": 12, "name": "视频", "type": 1, "resKey": "video", "path": "/list/video", "children": [ { "id": 13, "name": "详情", "type": 5, "resKey": "details", "path": "/list/video/details", "children": [ { "id": 28, "name": "下载", "type": 2, "resKey": "downLoadBtn", "path": "/", "children": [] } ] }, ] }, ] }
本文作者为gengboxb,转载请注明。