Browse Source

router配置代码添加注释

任一存 3 năm trước cách đây
mục cha
commit
dde94346e4
1 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 17 0
      new_backstage/src/configue/menu.js

+ 17 - 0
new_backstage/src/configue/menu.js

@@ -1,3 +1,14 @@
+/**
+ * name => 路由项的meta.name
+ * id => 路由项的meta.belong
+ * key => 路由项的name, 路由项的path中的第一层路径,路由项的meta.index,被渲染的组件在src/pages/systemOrType中的子路径名
+ * noEdit => 有无对应的编辑页面
+ * type => 路由项的meta.type, main中的key,分为system和content两类。
+ * param[n].key => 路由项的path中的param形式的第二、三、四…层路径,
+ * param[n].default => 没用到
+ * editParam[n].key => 对应的编辑页面的路由项的path中的【param形式的】第二、三、四…层路径,
+ * editParam[n].default => 没用到
+ */
 let routes = [
   {
     name: "史馆场景管理",
@@ -163,6 +174,9 @@ let routes = [
   },
 ];
 
+/**
+ * key与routes中的type相对应。也决定了被渲染的组件在pages下所在子路径。
+ */
 let main = [
   {
     name: "内容管理",
@@ -178,6 +192,9 @@ let main = [
   },
 ];
 
+/**
+ * main分为内容管理和系统管理两类,每一类会被加上routes字段,包含routes中类别相同的条目。
+ */
 let menu = main.map(item=>{
   let route = []
   routes.forEach((sub)=>{