@fangzhongya/vue-archive 0.0.3-16 → 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";const e=require("vue"),m=require("../../components/boxurl/index.vue.cjs"),p=require("../../components/compo/props.vue.cjs"),h=require("../../components/header/index.vue.cjs"),x=require("../../config.cjs"),f=require("../../utils/common.cjs"),d=require("../../utils/glob.cjs"),g={class:"__document-index"},E={class:"index-aside"},N={class:"index-aside-div"},k={class:"choice aside"},V=["onClick"],C={class:"aside-li-name"},y={class:"aside-li-name-name"},q={class:"index-body"},B={class:"index-div"},w={class:"index-header"},b={class:"index-main"},D={class:"index-main-div"},O=e.defineComponent({__name:"index",setup(P){const c=x.getConfig("components").map(t=>t.comprops),_=Object.values(d.getComponentPropsObjs()).filter(t=>{for(let s=0;s<c.length;s++){const n=c[s]||"";if(n&&f.isComprops(t.key,n))return!0}});function u(t){const n=new RegExp(t.comprops+"(.)$").exec(t.value);return n?n[1]:t.value}const i=e.ref(_),o=e.ref(i.value[0]),r=e.ref("");function v(t){o.value=t,a()}function a(){d.getPropsRaws([o.value]).then(t=>{const s=t[0];r.value=s.raw})}return a(),(t,s)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",E,[e.createElementVNode("div",N,[e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(n,R)=>{var l;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["aside-li",{on:n.key==((l=e.unref(o))==null?void 0:l.key)}]),onClick:$=>v(n)},[e.createVNode(m,{value:n},{default:e.withCtx(()=>[e.createElementVNode("div",C,[e.createElementVNode("div",y,e.toDisplayString(u(n)),1)])]),_:2},1032,["value"])],10,V)}),256))])])]),e.createElementVNode("div",q,[e.createElementVNode("div",B,[e.createElementVNode("div",w,[e.createVNode(h)]),e.createElementVNode("div",b,[e.createElementVNode("div",D,[e.createVNode(p,{value:r.value},null,8,["value"])])])])])]))}});module.exports=O;
|
|
1
|
+
"use strict";const e=require("vue"),m=require("../../components/boxurl/index.vue.cjs"),p=require("../../components/compo/props.vue.cjs"),h=require("../../components/header/index.vue.cjs"),x=require("../../config.cjs"),f=require("../../utils/common.cjs"),d=require("../../utils/glob.cjs"),g={class:"__document-index"},E={class:"index-aside"},N={class:"index-aside-div"},k={class:"choice aside"},V=["onClick"],C={class:"aside-li-name"},y={class:"aside-li-name-name"},q={class:"index-body"},B={class:"index-div"},w={class:"index-header"},b={class:"index-main"},D={class:"index-main-div"},O=e.defineComponent({__name:"index",setup(P){const c=x.getConfig("components").map(t=>t.comprops),_=Object.values(d.getComponentPropsObjs()).filter(t=>{for(let s=0;s<c.length;s++){const n=c[s]||"";if(n&&f.isComprops(t.key,n))return!0}});function u(t){const n=new RegExp(t.comprops+"(.)$").exec("/"+t.value);return n?n[1]:t.value}const i=e.ref(_),o=e.ref(i.value[0]),r=e.ref("");function v(t){o.value=t,a()}function a(){d.getPropsRaws([o.value]).then(t=>{const s=t[0];r.value=s.raw})}return a(),(t,s)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",E,[e.createElementVNode("div",N,[e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(n,R)=>{var l;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["aside-li",{on:n.key==((l=e.unref(o))==null?void 0:l.key)}]),onClick:$=>v(n)},[e.createVNode(m,{value:n},{default:e.withCtx(()=>[e.createElementVNode("div",C,[e.createElementVNode("div",y,e.toDisplayString(u(n)),1)])]),_:2},1032,["value"])],10,V)}),256))])])]),e.createElementVNode("div",q,[e.createElementVNode("div",B,[e.createElementVNode("div",w,[e.createVNode(h)]),e.createElementVNode("div",b,[e.createElementVNode("div",D,[e.createVNode(p,{value:r.value},null,8,["value"])])])])])]))}});module.exports=O;
|
|
@@ -18,7 +18,7 @@ const P = { class: "__document-index" }, R = { class: "index-aside" }, V = { cla
|
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
function p(e) {
|
|
21
|
-
const s = new RegExp(e.comprops + "(.)$").exec(e.value);
|
|
21
|
+
const s = new RegExp(e.comprops + "(.)$").exec("/" + e.value);
|
|
22
22
|
return s ? s[1] : e.value;
|
|
23
23
|
}
|
|
24
24
|
const l = i(v), n = i(l.value[0]), _ = i("");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../config.cjs"),
|
|
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
|
|
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
|
|
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
|
|
20
|
+
let a = "__document";
|
|
21
21
|
function P(e) {
|
|
22
22
|
var o;
|
|
23
|
-
|
|
24
|
-
let t = "/" +
|
|
25
|
-
|
|
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:
|
|
27
|
+
redirect: { name: a + "Index" }
|
|
28
28
|
}), y().forEach((n) => {
|
|
29
|
-
var
|
|
30
|
-
|
|
29
|
+
var r;
|
|
30
|
+
(r = m[0].children) == null || r.push({
|
|
31
31
|
path: n.value,
|
|
32
|
-
name:
|
|
32
|
+
name: a + n.name,
|
|
33
33
|
component: n.component
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
const i = d("redirect");
|
|
37
|
-
if (
|
|
38
|
-
e.addRoute(n), e.beforeEach((
|
|
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("刷新"),
|
|
41
|
+
document.referrer || h == 2 ? (console.log("刷新"), c = 2) : (console.log("地址栏输入 或者 刷新"), c = 3);
|
|
42
42
|
} else
|
|
43
|
-
console.log("跳转"),
|
|
43
|
+
console.log("跳转"), c = 1;
|
|
44
44
|
s("-keydown-F5", 0);
|
|
45
45
|
});
|
|
46
46
|
}), i) {
|
|
47
|
-
const n = e.getRoutes().filter((
|
|
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 :
|
|
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,
|
|
68
|
-
e[i](t), n && (o = e.resolve({ name: n }).path), u[o] =
|
|
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
|
|
70
|
+
function x(e, t) {
|
|
71
71
|
l(e, {
|
|
72
|
-
name:
|
|
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
|
|
79
|
+
function q(e, t) {
|
|
80
80
|
l(e, {
|
|
81
|
-
name:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
110
|
+
q as toDevelop,
|
|
111
111
|
l as toPage,
|
|
112
|
-
|
|
112
|
+
x as toSingle,
|
|
113
113
|
E as toTests
|
|
114
114
|
};
|