@fangzhongya/vue-archive 0.0.55 → 0.0.57
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.
- package/dist/index.css +1 -1
- package/dist/packages/components/choice/index.vue.cjs +1 -1
- package/dist/packages/components/choice/index.vue.js +52 -38
- package/dist/packages/components/code/highlight.vue.cjs +1 -1
- package/dist/packages/components/code/index.vue.cjs +1 -1
- package/dist/packages/components/compo/code.vue.cjs +1 -0
- package/dist/packages/components/compo/code.vue.js +21 -0
- package/dist/packages/components/compo/code.vue3.cjs +1 -0
- package/dist/packages/components/compo/code.vue3.js +5 -0
- package/dist/packages/components/main/index.vue.cjs +1 -1
- package/dist/packages/components/main/index.vue.js +36 -32
- package/dist/packages/components/test/index.vue.cjs +1 -1
- package/dist/packages/components/use/code.vue.cjs +1 -0
- package/dist/packages/components/use/code.vue.js +66 -0
- package/dist/packages/components/use/code.vue2.cjs +1 -0
- package/dist/packages/components/use/code.vue2.js +4 -0
- package/dist/packages/components/use/edit.cjs +18 -0
- package/dist/packages/components/use/edit.d.ts +32 -0
- package/dist/packages/components/use/edit.js +187 -0
- package/dist/packages/components/use/effect.d.ts +18 -0
- package/dist/packages/components/use/effect.vue.cjs +1 -0
- package/dist/packages/components/use/effect.vue.js +12 -0
- package/dist/packages/components/use/retrie/array/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/boolean/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/expose/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/index.d.ts +1 -1
- package/dist/packages/components/use/retrie/input/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/text.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/object/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/other/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/slot/index.vue.cjs +1 -1
- package/dist/packages/components/use/set-code.vue.cjs +1 -1
- package/dist/packages/components/use/set-code.vue.js +17 -58
- package/dist/packages/page/compon/index.vue2.cjs +1 -1
- package/dist/packages/page/compon/index.vue2.js +7 -7
- package/dist/packages/page/develop/index.vue2.cjs +1 -1
- package/dist/packages/page/develop/index.vue2.js +4 -4
- package/dist/packages/page/edit/index.vue.cjs +1 -0
- package/dist/packages/page/edit/index.vue.js +4 -0
- package/dist/packages/page/edit/index.vue2.cjs +1 -0
- package/dist/packages/page/edit/index.vue2.js +23 -0
- package/dist/packages/page/single/index.vue2.cjs +1 -1
- package/dist/packages/page/single/index.vue2.js +12 -12
- package/dist/packages/page/tests/index.vue2.cjs +1 -1
- package/dist/packages/page/tests/index.vue2.js +7 -7
- package/dist/packages/router/file.cjs +1 -1
- package/dist/packages/router/file.js +5 -4
- package/dist/packages/router/index.cjs +1 -1
- package/dist/packages/router/index.d.ts +1 -0
- package/dist/packages/router/index.js +55 -45
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as g, ref as i, createElementBlock as s, openBlock as a, createVNode as
|
|
1
|
+
import { defineComponent as g, ref as i, createElementBlock as s, openBlock as a, createVNode as d, withCtx as y, createElementVNode as _, Fragment as v, renderList as f, normalizeClass as x, toDisplayString as $ } from "vue";
|
|
2
2
|
import N from "../../components/compo/info.vue.js";
|
|
3
3
|
import b from "../../components/choice/index.vue.js";
|
|
4
4
|
import B from "../../components/test/index.vue.js";
|
|
5
5
|
import { getTestName as E } from "../../utils/glob.js";
|
|
6
|
-
const L = { class: "__document-tests" }, S = { class: "tests-top" }, V = ["onClick"], j = {
|
|
6
|
+
const L = { class: "__document-index __document-tests" }, S = { class: "tests-top" }, V = ["onClick"], j = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "tests-test"
|
|
9
9
|
}, w = { class: "tests-test-li" }, z = { key: 1 }, H = /* @__PURE__ */ g({
|
|
10
10
|
__name: "index",
|
|
11
11
|
setup(D) {
|
|
12
|
-
const o = i([]), n = i([]),
|
|
12
|
+
const o = i([]), n = i([]), r = i(), m = i(""), p = [
|
|
13
13
|
{ name: "全部", id: "" },
|
|
14
14
|
{ name: "正常", id: "1" },
|
|
15
15
|
{ name: "更新", id: "2" },
|
|
@@ -27,7 +27,7 @@ const L = { class: "__document-tests" }, S = { class: "tests-top" }, V = ["onCli
|
|
|
27
27
|
e.push(l), u[t] = e;
|
|
28
28
|
}
|
|
29
29
|
function k(t) {
|
|
30
|
-
|
|
30
|
+
r.value = t, o.value = E(t.key), n.value = [...o.value];
|
|
31
31
|
}
|
|
32
32
|
function C(t) {
|
|
33
33
|
let l = t.id;
|
|
@@ -38,9 +38,9 @@ const L = { class: "__document-tests" }, S = { class: "tests-top" }, V = ["onCli
|
|
|
38
38
|
n.value = [...o.value];
|
|
39
39
|
}
|
|
40
40
|
return (t, l) => (a(), s("div", L, [
|
|
41
|
-
|
|
41
|
+
d(b, { onChange: k }, {
|
|
42
42
|
default: y(() => [
|
|
43
|
-
|
|
43
|
+
d(N, { value: r.value }, null, 8, ["value"]),
|
|
44
44
|
_("div", S, [
|
|
45
45
|
(a(), s(v, null, f(p, (e, c) => _("span", {
|
|
46
46
|
class: x(["but-div", { on: m.value == e.id }]),
|
|
@@ -50,7 +50,7 @@ const L = { class: "__document-tests" }, S = { class: "tests-top" }, V = ["onCli
|
|
|
50
50
|
]),
|
|
51
51
|
n.value && n.value.length > 0 ? (a(), s("div", j, [
|
|
52
52
|
(a(!0), s(v, null, f(n.value, (e) => (a(), s("div", w, [
|
|
53
|
-
|
|
53
|
+
d(B, {
|
|
54
54
|
onState: h,
|
|
55
55
|
value: e
|
|
56
56
|
}, null, 8, ["value"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=e=>Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"}));function u(){return Object.assign({"../page/compon/index.vue":()=>Promise.resolve().then(()=>n(require("../page/compon/index.vue.cjs"))),"../page/comprops/index.vue":()=>Promise.resolve().then(()=>n(require("../page/comprops/index.vue.cjs"))),"../page/develop/index.vue":()=>Promise.resolve().then(()=>n(require("../page/develop/index.vue.cjs"))),"../page/edit/index.vue":()=>Promise.resolve().then(()=>n(require("../page/edit/index.vue.cjs"))),"../page/index/index.vue":()=>Promise.resolve().then(()=>n(require("../page/index/index.vue.cjs"))),"../page/single/index.vue":()=>Promise.resolve().then(()=>n(require("../page/single/index.vue.cjs"))),"../page/tests/index.vue":()=>Promise.resolve().then(()=>n(require("../page/tests/index.vue.cjs")))})}function a(e){let t=e.replace(/\.\/|\/index.(ts|vue)/g,"");return t=t.replace(".page/",""),t}function l(e){let t=e.split("/"),r=[];return t.forEach(o=>{r.push(...o.split("-"))}),r=r.map(o=>o.slice(0,1).toUpperCase()+o.slice(1)),r.join("")}function p(e){return e}function g(){const e=[],t=u();for(const r in t){const o=t[r];let i=a(r),s=i;i=l(i),e.push({name:i,key:r,value:s,component:o})}return e}exports.getFileName=g;exports.getRouterName=l;exports.getRouterValueName=p;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
function
|
|
1
|
+
function r() {
|
|
2
2
|
return /* @__PURE__ */ Object.assign({
|
|
3
3
|
"../page/compon/index.vue": () => import("../page/compon/index.vue.js"),
|
|
4
4
|
"../page/comprops/index.vue": () => import("../page/comprops/index.vue.js"),
|
|
5
5
|
"../page/develop/index.vue": () => import("../page/develop/index.vue.js"),
|
|
6
|
+
"../page/edit/index.vue": () => import("../page/edit/index.vue.js"),
|
|
6
7
|
"../page/index/index.vue": () => import("../page/index/index.vue.js"),
|
|
7
8
|
"../page/single/index.vue": () => import("../page/single/index.vue.js"),
|
|
8
9
|
"../page/tests/index.vue": () => import("../page/tests/index.vue.js")
|
|
@@ -22,14 +23,14 @@ function u(e) {
|
|
|
22
23
|
return e;
|
|
23
24
|
}
|
|
24
25
|
function l() {
|
|
25
|
-
const e = [], t =
|
|
26
|
+
const e = [], t = r();
|
|
26
27
|
for (const n in t) {
|
|
27
28
|
const o = t[n];
|
|
28
|
-
let p = a(n),
|
|
29
|
+
let p = a(n), i = p;
|
|
29
30
|
p = s(p), e.push({
|
|
30
31
|
name: p,
|
|
31
32
|
key: n,
|
|
32
|
-
value:
|
|
33
|
+
value: i,
|
|
33
34
|
component: o
|
|
34
35
|
});
|
|
35
36
|
}
|
|
@@ -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");require("@fangzhongya/utils/basic/string/firstUpper");const f=require("./file.cjs"),g=e=>Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"})),s=[{path:"/__document",name:"__document",component:()=>Promise.resolve().then(()=>g(require("../index/index.vue.cjs"))),redirect:{name:"__documentIndex"},meta:{title:"文档"},children:[]}];let m=0;document.addEventListener("keydown",y);function y(e){e=e||window.event,(e.ctrlKey&&e.location==82||e.location==116)&&l.setSession("-keydown-F5",2)}let o="__document";function h(e){o=u.getConfig("router")||"__document";let t="/"+o;s[0].path=t,s[0].redirect={name:o+"Index"},s[0].children?.unshift({path:t+"/:chapters+",redirect:{name:o+"Index"}}),f.getFileName().forEach(n=>{s[0].children?.push({path:n.value,name:o+n.name,component:n.component})});const a=u.getConfig("redirect");if(s.forEach(n=>{e.addRoute(n),e.beforeEach((i,c)=>{if(c.fullPath=="/"){let p=l.getSession("-keydown-F5");document.referrer||p==2?(console.log("刷新"),m=2):(console.log("地址栏输入 或者 刷新"),m=3)}else console.log("跳转"),m=1;l.setSession("-keydown-F5",0)})}),a){const n=e.getRoutes().filter(i=>i.path=="/")[0]||{path:"/"};n.redirect=t,n.name?e.addRoute(n.name,n):e.addRoute(n)}}const d={};function k(e){let t=e.path,a=e.params;if(a&&Object.keys(a).length)return a;{let n=d[t];return n&&Object.keys(n).length?n:m==3?{}:l.getSession("router.toPage."+t)}}function r(e,t,a="push"){let n=t.path||"";const i=t.name,c=t.params||{};e[a](t),i&&(n=e.resolve({name:i}).path),d[n]=c,l.setSession("router.toPage."+n,c)}function v(e,t){r(e,{name:o+"Single",query:{id:t.name+"/"+t.value},params:{key:t.key,comkey:t.comkey}})}function _(e,t){r(e,{name:o+"Develop",query:{id:t.value},params:{key:t.key}})}function P(e,t){r(e,{name:o+"Edit",query:{id:t.value},params:{key:t.key}})}function S(e,t){r(e,{name:o+"Tests",query:{id:t.value},params:{key:t.key}})}function q(e,t){r(e,{name:o+"Compon",query:{id:t.value},params:{key:t.key}})}exports.getPageParams=k;exports.init=h;exports.toCompon=q;exports.toDevelop=_;exports.toEdit=P;exports.toPage=r;exports.toSingle=v;exports.toTests=S;
|
|
@@ -14,6 +14,7 @@ export declare function toPage(router: Router, push: PushObj, type?: ToPush): vo
|
|
|
14
14
|
export declare function tos(router: Router, obj: ComponentsObj, name?: string): void;
|
|
15
15
|
export declare function toSingle(router: Router, obj: TestsObj): void;
|
|
16
16
|
export declare function toDevelop(router: Router, obj: ComponentsObj): void;
|
|
17
|
+
export declare function toEdit(router: Router, obj: ComponentsObj): void;
|
|
17
18
|
export declare function toTests(router: Router, obj: ComponentsObj): void;
|
|
18
19
|
export declare function toCompon(router: Router, obj: ComponentsObj): void;
|
|
19
20
|
export declare function toIndex(router: Router, id: string): void;
|
|
@@ -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 "@fangzhongya/utils/basic/string/firstUpper";
|
|
4
|
-
import { getFileName as
|
|
4
|
+
import { getFileName as y } from "./file.js";
|
|
5
5
|
const i = [
|
|
6
6
|
{
|
|
7
7
|
path: "/__document",
|
|
@@ -12,20 +12,20 @@ const i = [
|
|
|
12
12
|
children: []
|
|
13
13
|
}
|
|
14
14
|
];
|
|
15
|
-
let
|
|
16
|
-
document.addEventListener("keydown",
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
let l = 0;
|
|
16
|
+
document.addEventListener("keydown", h);
|
|
17
|
+
function h(t) {
|
|
18
|
+
t = t || window.event, (t.ctrlKey && t.location == 82 || //ctrl+R
|
|
19
|
+
t.location == 116) && s("-keydown-F5", 2);
|
|
20
20
|
}
|
|
21
21
|
let o = "__document";
|
|
22
|
-
function P(
|
|
22
|
+
function P(t) {
|
|
23
23
|
o = d("router") || "__document";
|
|
24
|
-
let
|
|
25
|
-
i[0].path =
|
|
26
|
-
path:
|
|
24
|
+
let e = "/" + o;
|
|
25
|
+
i[0].path = e, i[0].redirect = { name: o + "Index" }, i[0].children?.unshift({
|
|
26
|
+
path: e + "/:chapters+",
|
|
27
27
|
redirect: { name: o + "Index" }
|
|
28
|
-
}),
|
|
28
|
+
}), y().forEach((n) => {
|
|
29
29
|
i[0].children?.push({
|
|
30
30
|
path: n.value,
|
|
31
31
|
name: o + n.name,
|
|
@@ -34,78 +34,88 @@ function P(e) {
|
|
|
34
34
|
});
|
|
35
35
|
const a = d("redirect");
|
|
36
36
|
if (i.forEach((n) => {
|
|
37
|
-
|
|
38
|
-
if (
|
|
37
|
+
t.addRoute(n), t.beforeEach((r, c) => {
|
|
38
|
+
if (c.fullPath == "/") {
|
|
39
39
|
let f = p("-keydown-F5");
|
|
40
|
-
document.referrer || f == 2 ? (console.log("刷新"),
|
|
40
|
+
document.referrer || f == 2 ? (console.log("刷新"), l = 2) : (console.log("地址栏输入 或者 刷新"), l = 3);
|
|
41
41
|
} else
|
|
42
|
-
console.log("跳转"),
|
|
42
|
+
console.log("跳转"), l = 1;
|
|
43
43
|
s("-keydown-F5", 0);
|
|
44
44
|
});
|
|
45
45
|
}), a) {
|
|
46
|
-
const n =
|
|
46
|
+
const n = t.getRoutes().filter((r) => r.path == "/")[0] || {
|
|
47
47
|
path: "/"
|
|
48
48
|
};
|
|
49
|
-
n.redirect =
|
|
49
|
+
n.redirect = e, n.name ? t.addRoute(n.name, n) : t.addRoute(n);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
const u = {};
|
|
53
|
-
function w(
|
|
54
|
-
let
|
|
53
|
+
function w(t) {
|
|
54
|
+
let e = t.path, a = t.params;
|
|
55
55
|
if (a && Object.keys(a).length)
|
|
56
56
|
return a;
|
|
57
57
|
{
|
|
58
|
-
let n = u[
|
|
59
|
-
return n && Object.keys(n).length ? n :
|
|
58
|
+
let n = u[e];
|
|
59
|
+
return n && Object.keys(n).length ? n : l == 3 ? {} : p("router.toPage." + e);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
let n =
|
|
64
|
-
const r =
|
|
65
|
-
|
|
62
|
+
function m(t, e, a = "push") {
|
|
63
|
+
let n = e.path || "";
|
|
64
|
+
const r = e.name, c = e.params || {};
|
|
65
|
+
t[a](e), r && (n = t.resolve({ name: r }).path), u[n] = c, s("router.toPage." + n, c);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
67
|
+
function E(t, e) {
|
|
68
|
+
m(t, {
|
|
69
69
|
name: o + "Single",
|
|
70
70
|
query: {
|
|
71
|
-
id:
|
|
71
|
+
id: e.name + "/" + e.value
|
|
72
72
|
},
|
|
73
|
-
params: { key:
|
|
73
|
+
params: { key: e.key, comkey: e.comkey }
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
function q(
|
|
77
|
-
|
|
76
|
+
function q(t, e) {
|
|
77
|
+
m(t, {
|
|
78
78
|
name: o + "Develop",
|
|
79
79
|
query: {
|
|
80
|
-
id:
|
|
80
|
+
id: e.value
|
|
81
81
|
},
|
|
82
|
-
params: { key:
|
|
82
|
+
params: { key: e.key }
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
85
|
+
function x(t, e) {
|
|
86
|
+
m(t, {
|
|
87
|
+
name: o + "Edit",
|
|
88
|
+
query: {
|
|
89
|
+
id: e.value
|
|
90
|
+
},
|
|
91
|
+
params: { key: e.key }
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function F(t, e) {
|
|
95
|
+
m(t, {
|
|
87
96
|
name: o + "Tests",
|
|
88
97
|
query: {
|
|
89
|
-
id:
|
|
98
|
+
id: e.value
|
|
90
99
|
},
|
|
91
|
-
params: { key:
|
|
100
|
+
params: { key: e.key }
|
|
92
101
|
});
|
|
93
102
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
103
|
+
function R(t, e) {
|
|
104
|
+
m(t, {
|
|
96
105
|
name: o + "Compon",
|
|
97
106
|
query: {
|
|
98
|
-
id:
|
|
107
|
+
id: e.value
|
|
99
108
|
},
|
|
100
|
-
params: { key:
|
|
109
|
+
params: { key: e.key }
|
|
101
110
|
});
|
|
102
111
|
}
|
|
103
112
|
export {
|
|
104
113
|
w as getPageParams,
|
|
105
114
|
P as init,
|
|
106
|
-
|
|
115
|
+
R as toCompon,
|
|
107
116
|
q as toDevelop,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
E as
|
|
117
|
+
x as toEdit,
|
|
118
|
+
m as toPage,
|
|
119
|
+
E as toSingle,
|
|
120
|
+
F as toTests
|
|
111
121
|
};
|