@fangzhongya/vue-archive 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const e=require("../config.cjs"),t=require("../utils/storage.cjs"),n=require("./file.cjs");require("@fangzhongya/utils/basic/string/firstUpper");var r=`__document`,i=[{path:`/__document`,name:r,component:()=>Promise.resolve().then(()=>require("../index/index.cjs")),redirect:{name:`__documentIndex`},meta:{title:`文档`},children:[]}];document.addEventListener(`keydown`,a);function a(e){e||=window.event,(e.ctrlKey&&e.location==82||e.location==116)&&t.setSession(`-keydown-F5`,2)}var o=r;function s(a){o=e.getConfig(`router`)||r;let s=`/`+o;if(i[0].path=s,i[0].name=o,i[0].redirect={name:o+`Index`},i[0].children?.unshift({path:s+`/:chapters+`,redirect:{name:o+`Index`}}),n.getFileName().forEach(e=>{i[0].children?.push({path:e.value,name:o+e.name,component:e.component})}),i.forEach(e=>{a.addRoute(e)}),a.beforeEach((e,n)=>{if(n.fullPath==`/`){let e=t.getSession(`-keydown-F5`);document.referrer||e==2?console.log(`刷新`):console.log(`地址栏输入 或者 刷新`)}else console.log(`跳转`);return t.setSession(`-keydown-F5`,0),!0}),e.getConfig(`redirect`)){let e=a.getRoutes().filter(e=>e.path==`/`)[0]||{path:`/`};e.redirect=s,e.name?a.addRoute(e.name,e):a.addRoute(e)}}exports.init=s;
1
+ const e=require("../config.cjs"),t=require("../utils/storage.cjs"),n=require("./file.cjs");require("@fangzhongya/utils/basic/string/firstUpper");var r=`__document`,i=[{path:`/__document`,name:r,component:()=>Promise.resolve().then(()=>require("../index/index.cjs")),redirect:{name:`__documentIndex`},meta:{title:`文档`},children:[]}];document.addEventListener(`keydown`,a);function a(e){e||=window.event,(e.ctrlKey&&e.location==82||e.location==116)&&t.setSession(`-keydown-F5`,2)}var o=r;function s(a){o=e.getConfig(`router`)||r;let s=`/`+o,c=n.getFileName();for(let e=0;e<c.length;e++){let t=c[e];i[0].children?.push({path:t.value,name:o+t.name,component:t.component})}if(i[0].path=s,i[0].name=o,i[0].redirect={name:o+`Index`},i[0].children?.unshift({path:s+`/:chapters+`,redirect:{name:o+`Index`}}),i.forEach(e=>{a.addRoute(e)}),a.beforeEach((e,n)=>{if(n.fullPath==`/`){let e=t.getSession(`-keydown-F5`);document.referrer||e==2?console.log(`刷新`):console.log(`地址栏输入 或者 刷新`)}else console.log(`跳转`);return t.setSession(`-keydown-F5`,0),!0}),e.getConfig(`redirect`)){let e=a.getRoutes().filter(e=>e.path==`/`)[0]||{path:`/`};e.redirect=s,e.name?a.addRoute(e.name,e):a.addRoute(e)}}exports.init=s;
@@ -18,16 +18,18 @@ function o(e) {
18
18
  var s = i;
19
19
  function c(o) {
20
20
  s = e("router") || i;
21
- let c = "/" + s;
21
+ let c = "/" + s, l = r();
22
+ for (let e = 0; e < l.length; e++) {
23
+ let t = l[e];
24
+ a[0].children?.push({
25
+ path: t.value,
26
+ name: s + t.name,
27
+ component: t.component
28
+ });
29
+ }
22
30
  if (a[0].path = c, a[0].name = s, a[0].redirect = { name: s + "Index" }, a[0].children?.unshift({
23
31
  path: c + "/:chapters+",
24
32
  redirect: { name: s + "Index" }
25
- }), r().forEach((e) => {
26
- a[0].children?.push({
27
- path: e.value,
28
- name: s + e.name,
29
- component: e.component
30
- });
31
33
  }), a.forEach((e) => {
32
34
  o.addRoute(e);
33
35
  }), o.beforeEach((e, r) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.1.21",
4
+ "version": "0.1.22",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",