@fangzhongya/vue-archive 0.0.3-17 → 0.0.3-18

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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../config.cjs"),s=require("../utils/storage.cjs"),g=require("./file.cjs"),y=e=>Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"})),c=[{path:"/__document",name:"__document",component:()=>Promise.resolve().then(()=>y(require("../index/index.vue.cjs"))),redirect:{name:"__documentIndex"},meta:{title:"文档"},children:[]}];let m=0;document.addEventListener("keydown",h);function h(e){e=e||window.event,(e.ctrlKey&&e.location==82||e.location==116)&&s.setSession("-keydown-F5",2)}let r="__document";function k(e){var o;r=u.getConfig("router")||"__document";let t="/"+r;c[0].path=t,(o=c[0].children)==null||o.unshift({path:t+"/:chapters+",redirect:{name:r+"Index"}}),g.getFileName().forEach(n=>{var a;console.log(n),(a=c[0].children)==null||a.push({path:n.value,name:r+n.name,component:n.component})});const i=u.getConfig("redirect");if(c.forEach(n=>{e.addRoute(n),e.beforeEach((a,p)=>{if(p.fullPath=="/"){let f=s.getSession("-keydown-F5");document.referrer||f==2?(console.log("刷新"),m=2):(console.log("地址栏输入 或者 刷新"),m=3)}else console.log("跳转"),m=1;s.setSession("-keydown-F5",0)})}),i){const n=e.getRoutes().filter(a=>a.path=="/")[0]||{path:"/"};n.redirect=t,n.name?e.addRoute(n.name,n):e.addRoute(n)}}const d={};function _(e){let t=e.path,i=e.params;if(i&&Object.keys(i).length)return i;{let o=d[t];return o&&Object.keys(o).length?o:m==3?{}:s.getSession("router.toPage."+t)}}function l(e,t,i="push"){let o=t.path||"";const n=t.name,a=t.params||{};e[i](t),n&&(o=e.resolve({name:n}).path),d[o]=a,s.setSession("router.toPage."+o,a)}function v(e,t){l(e,{name:r+"Single",query:{id:t.name+"/"+t.value},params:{key:t.key,comkey:t.comkey}})}function P(e,t){l(e,{name:r+"Develop",query:{id:t.value},params:{key:t.key}})}function S(e,t){l(e,{name:r+"Tests",query:{id:t.value},params:{key:t.key}})}function q(e,t){l(e,{name:r+"Compon",query:{id:t.value},params:{key:t.key}})}exports.getPageParams=_;exports.init=k;exports.toCompon=q;exports.toDevelop=P;exports.toPage=l;exports.toSingle=v;exports.toTests=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../config.cjs"),l=require("../utils/storage.cjs"),g=require("./file.cjs"),y=e=>Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"})),s=[{path:"/__document",name:"__document",component:()=>Promise.resolve().then(()=>y(require("../index/index.vue.cjs"))),redirect:{name:"__documentIndex"},meta:{title:"文档"},children:[]}];let m=0;document.addEventListener("keydown",h);function h(e){e=e||window.event,(e.ctrlKey&&e.location==82||e.location==116)&&l.setSession("-keydown-F5",2)}let a="__document";function k(e){var o;a=u.getConfig("router")||"__document";let t="/"+a;s[0].path=t,s[0].redirect={name:a+"Index"},(o=s[0].children)==null||o.unshift({path:t+"/:chapters+",redirect:{name:a+"Index"}}),g.getFileName().forEach(n=>{var r;(r=s[0].children)==null||r.push({path:n.value,name:a+n.name,component:n.component})});const i=u.getConfig("redirect");if(s.forEach(n=>{e.addRoute(n),e.beforeEach((r,p)=>{if(p.fullPath=="/"){let f=l.getSession("-keydown-F5");document.referrer||f==2?(console.log("刷新"),m=2):(console.log("地址栏输入 或者 刷新"),m=3)}else console.log("跳转"),m=1;l.setSession("-keydown-F5",0)})}),i){const n=e.getRoutes().filter(r=>r.path=="/")[0]||{path:"/"};n.redirect=t,n.name?e.addRoute(n.name,n):e.addRoute(n)}}const d={};function _(e){let t=e.path,i=e.params;if(i&&Object.keys(i).length)return i;{let o=d[t];return o&&Object.keys(o).length?o:m==3?{}:l.getSession("router.toPage."+t)}}function c(e,t,i="push"){let o=t.path||"";const n=t.name,r=t.params||{};e[i](t),n&&(o=e.resolve({name:n}).path),d[o]=r,l.setSession("router.toPage."+o,r)}function v(e,t){c(e,{name:a+"Single",query:{id:t.name+"/"+t.value},params:{key:t.key,comkey:t.comkey}})}function P(e,t){c(e,{name:a+"Develop",query:{id:t.value},params:{key:t.key}})}function S(e,t){c(e,{name:a+"Tests",query:{id:t.value},params:{key:t.key}})}function q(e,t){c(e,{name:a+"Compon",query:{id:t.value},params:{key:t.key}})}exports.getPageParams=_;exports.init=k;exports.toCompon=q;exports.toDevelop=P;exports.toPage=c;exports.toSingle=v;exports.toTests=S;
@@ -1,7 +1,7 @@
1
1
  import { getConfig as d } from "../config.js";
2
2
  import { setSession as s, getSession as p } from "../utils/storage.js";
3
3
  import { getFileName as y } from "./file.js";
4
- const c = [
4
+ const m = [
5
5
  {
6
6
  path: "/__document",
7
7
  name: "__document",
@@ -11,40 +11,40 @@ const c = [
11
11
  children: []
12
12
  }
13
13
  ];
14
- let m = 0;
14
+ let c = 0;
15
15
  document.addEventListener("keydown", g);
16
16
  function g(e) {
17
17
  e = e || window.event, (e.ctrlKey && e.location == 82 || //ctrl+R
18
18
  e.location == 116) && s("-keydown-F5", 2);
19
19
  }
20
- let r = "__document";
20
+ let a = "__document";
21
21
  function P(e) {
22
22
  var o;
23
- r = d("router") || "__document";
24
- let t = "/" + r;
25
- c[0].path = t, (o = c[0].children) == null || o.unshift({
23
+ a = d("router") || "__document";
24
+ let t = "/" + a;
25
+ m[0].path = t, m[0].redirect = { name: a + "Index" }, (o = m[0].children) == null || o.unshift({
26
26
  path: t + "/:chapters+",
27
- redirect: { name: r + "Index" }
27
+ redirect: { name: a + "Index" }
28
28
  }), y().forEach((n) => {
29
- var a;
30
- console.log(n), (a = c[0].children) == null || a.push({
29
+ var r;
30
+ (r = m[0].children) == null || r.push({
31
31
  path: n.value,
32
- name: r + n.name,
32
+ name: a + n.name,
33
33
  component: n.component
34
34
  });
35
35
  });
36
36
  const i = d("redirect");
37
- if (c.forEach((n) => {
38
- e.addRoute(n), e.beforeEach((a, f) => {
37
+ if (m.forEach((n) => {
38
+ e.addRoute(n), e.beforeEach((r, f) => {
39
39
  if (f.fullPath == "/") {
40
40
  let h = p("-keydown-F5");
41
- document.referrer || h == 2 ? (console.log("刷新"), m = 2) : (console.log("地址栏输入 或者 刷新"), m = 3);
41
+ document.referrer || h == 2 ? (console.log("刷新"), c = 2) : (console.log("地址栏输入 或者 刷新"), c = 3);
42
42
  } else
43
- console.log("跳转"), m = 1;
43
+ console.log("跳转"), c = 1;
44
44
  s("-keydown-F5", 0);
45
45
  });
46
46
  }), i) {
47
- const n = e.getRoutes().filter((a) => a.path == "/")[0] || {
47
+ const n = e.getRoutes().filter((r) => r.path == "/")[0] || {
48
48
  path: "/"
49
49
  };
50
50
  n.redirect = t, n.name ? e.addRoute(n.name, n) : e.addRoute(n);
@@ -57,28 +57,28 @@ function w(e) {
57
57
  return i;
58
58
  {
59
59
  let o = u[t];
60
- return o && Object.keys(o).length ? o : m == 3 ? {} : p(
60
+ return o && Object.keys(o).length ? o : c == 3 ? {} : p(
61
61
  "router.toPage." + t
62
62
  );
63
63
  }
64
64
  }
65
65
  function l(e, t, i = "push") {
66
66
  let o = t.path || "";
67
- const n = t.name, a = t.params || {};
68
- e[i](t), n && (o = e.resolve({ name: n }).path), u[o] = a, s("router.toPage." + o, a);
67
+ const n = t.name, r = t.params || {};
68
+ e[i](t), n && (o = e.resolve({ name: n }).path), u[o] = r, s("router.toPage." + o, r);
69
69
  }
70
- function q(e, t) {
70
+ function x(e, t) {
71
71
  l(e, {
72
- name: r + "Single",
72
+ name: a + "Single",
73
73
  query: {
74
74
  id: t.name + "/" + t.value
75
75
  },
76
76
  params: { key: t.key, comkey: t.comkey }
77
77
  });
78
78
  }
79
- function x(e, t) {
79
+ function q(e, t) {
80
80
  l(e, {
81
- name: r + "Develop",
81
+ name: a + "Develop",
82
82
  query: {
83
83
  id: t.value
84
84
  },
@@ -87,7 +87,7 @@ function x(e, t) {
87
87
  }
88
88
  function E(e, t) {
89
89
  l(e, {
90
- name: r + "Tests",
90
+ name: a + "Tests",
91
91
  query: {
92
92
  id: t.value
93
93
  },
@@ -96,7 +96,7 @@ function E(e, t) {
96
96
  }
97
97
  function F(e, t) {
98
98
  l(e, {
99
- name: r + "Compon",
99
+ name: a + "Compon",
100
100
  query: {
101
101
  id: t.value
102
102
  },
@@ -107,8 +107,8 @@ export {
107
107
  w as getPageParams,
108
108
  P as init,
109
109
  F as toCompon,
110
- x as toDevelop,
110
+ q as toDevelop,
111
111
  l as toPage,
112
- q as toSingle,
112
+ x as toSingle,
113
113
  E as toTests
114
114
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.3-17",
4
+ "version": "0.0.3-18",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",