@fangzhongya/vue-archive 0.0.2-37 → 0.0.2-39
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/node/index.cjs +4 -5
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.js +4 -5
- package/dist/packages/components/compo/index.cjs +1 -1
- package/dist/packages/components/compo/index.d.ts +2 -1
- package/dist/packages/components/compo/index.js +35 -42
- package/dist/packages/components/compo/index.vue.cjs +1 -1
- package/dist/packages/components/compo/index.vue.js +50 -95
- package/dist/packages/components/compo/props.vue.cjs +1 -0
- package/dist/packages/components/compo/props.vue.d.ts +8 -0
- package/dist/packages/components/compo/props.vue.js +82 -0
- package/dist/packages/components/compo/props.vue2.cjs +1 -0
- package/dist/packages/components/compo/props.vue2.js +4 -0
- package/dist/packages/components/test/index.vue.cjs +1 -1
- package/dist/packages/components/test/index.vue.js +27 -27
- package/dist/packages/config.d.ts +2 -1
- package/dist/packages/page/comprops/index.vue.cjs +1 -0
- package/dist/packages/page/comprops/index.vue.d.ts +2 -0
- package/dist/packages/page/comprops/index.vue.js +4 -0
- package/dist/packages/page/comprops/index.vue2.cjs +1 -0
- package/dist/packages/page/comprops/index.vue2.js +68 -0
- package/dist/packages/router/index.cjs +1 -1
- package/dist/packages/router/index.js +44 -38
- package/dist/packages/utils/common.d.ts +1 -0
- package/dist/packages/utils/glob.cjs +2 -2
- package/dist/packages/utils/glob.d.ts +5 -1
- package/dist/packages/utils/glob.js +69 -63
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -66351,7 +66351,7 @@ function h3(div, sx, v) {
|
|
|
66351
66351
|
}
|
|
66352
66352
|
var setHtml = h3;
|
|
66353
66353
|
var configObj;
|
|
66354
|
-
var
|
|
66354
|
+
var comps = [];
|
|
66355
66355
|
async function nodeInit(c, callback) {
|
|
66356
66356
|
configObj = userConfig(c);
|
|
66357
66357
|
configObj._callback_ = callback;
|
|
@@ -66359,10 +66359,9 @@ async function nodeInit(c, callback) {
|
|
|
66359
66359
|
setHtml = c.setHtml;
|
|
66360
66360
|
}
|
|
66361
66361
|
Fang = runDev(_optionalChain([c, 'optionalAccess', _64 => _64.create]));
|
|
66362
|
-
|
|
66362
|
+
comps = getCompoNameObj();
|
|
66363
66363
|
for (let index = 0; index < comps.length; index++) {
|
|
66364
66364
|
const element = comps[index];
|
|
66365
|
-
mls.push(element);
|
|
66366
66365
|
await getCompoData(element);
|
|
66367
66366
|
}
|
|
66368
66367
|
}
|
|
@@ -66397,9 +66396,9 @@ function setMd(obj, arr) {
|
|
|
66397
66396
|
"/" + obj.value + "/index.md"
|
|
66398
66397
|
);
|
|
66399
66398
|
Fang.fileOpen(sc, arr.join("\n\n"));
|
|
66400
|
-
if (
|
|
66399
|
+
if (comps.length == lss) {
|
|
66401
66400
|
if (configObj._callback_) {
|
|
66402
|
-
configObj._callback_(
|
|
66401
|
+
configObj._callback_(comps);
|
|
66403
66402
|
}
|
|
66404
66403
|
}
|
|
66405
66404
|
}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -62,11 +62,13 @@ interface ExampleObj {
|
|
|
62
62
|
interface Config {
|
|
63
63
|
router?: string;
|
|
64
64
|
redirect?: boolean;
|
|
65
|
+
useparam?: boolean;
|
|
65
66
|
components: Array<Components>;
|
|
66
67
|
example?: ExampleObj;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
interface TextObj {
|
|
71
|
+
name: string;
|
|
70
72
|
value: string;
|
|
71
73
|
suffix: string;
|
|
72
74
|
key: string;
|
package/dist/node/index.js
CHANGED
|
@@ -66351,7 +66351,7 @@ function h3(div, sx, v) {
|
|
|
66351
66351
|
}
|
|
66352
66352
|
var setHtml = h3;
|
|
66353
66353
|
var configObj;
|
|
66354
|
-
var
|
|
66354
|
+
var comps = [];
|
|
66355
66355
|
async function nodeInit(c, callback) {
|
|
66356
66356
|
configObj = userConfig(c);
|
|
66357
66357
|
configObj._callback_ = callback;
|
|
@@ -66359,10 +66359,9 @@ async function nodeInit(c, callback) {
|
|
|
66359
66359
|
setHtml = c.setHtml;
|
|
66360
66360
|
}
|
|
66361
66361
|
Fang = runDev(c?.create);
|
|
66362
|
-
|
|
66362
|
+
comps = getCompoNameObj();
|
|
66363
66363
|
for (let index = 0; index < comps.length; index++) {
|
|
66364
66364
|
const element = comps[index];
|
|
66365
|
-
mls.push(element);
|
|
66366
66365
|
await getCompoData(element);
|
|
66367
66366
|
}
|
|
66368
66367
|
}
|
|
@@ -66397,9 +66396,9 @@ function setMd(obj, arr) {
|
|
|
66397
66396
|
"/" + obj.value + "/index.md"
|
|
66398
66397
|
);
|
|
66399
66398
|
Fang.fileOpen(sc, arr.join("\n\n"));
|
|
66400
|
-
if (
|
|
66399
|
+
if (comps.length == lss) {
|
|
66401
66400
|
if (configObj._callback_) {
|
|
66402
|
-
configObj._callback_(
|
|
66401
|
+
configObj._callback_(comps);
|
|
66403
66402
|
}
|
|
66404
66403
|
}
|
|
66405
66404
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../../utils/index.cjs"),a=require("../../utils/props.cjs"),c={titles:[],propss:[],slots:[],emitss:[],exposes:[]};function h(e,s){let r=e.charAt(0),l=[['"','"'],["'","'"],["`","`"],["(",")"],["{","}"],["[","]"]],o=l.map(i=>i[0]).indexOf(r);if(o!=-1){let n=new RegExp("^"+l[o][0]+"((.|\\n|\\r)+?)"+l[o][1]+(s?"\\s":""),"gi").exec(e);if(n)return n[0]}}function E(e){delete e.problems,delete e.source;let s=e.tag,r=e.name,l=e.description,t=e.default,o="";if(s=="default")r=r.trim(),r=h(r)||r;else if(s=="selectable")r=r.trim();else{if(r.includes("=")){const f=r.split("=");r=f[0];const x=f[1]+" "+l,d=h(x,!0);d?(t=d,l=x.replace(d,"")):t=e.default||f[1]||""}const n=/\s*\((.*)\)\s/gi.exec(l);n&&n.length>0&&(o=n[1],l=l.replace(n[0],""))}return e.name=r,e.default=t||"",e.description=l,e.selectable=o,e}function O(e){let s=["title","text","author","date"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),g(l),r.arr.forEach(t=>{m(t.key,t.value)})}function g(e){c.titles.push(e)}function T(e){let s=["props","name","type","default","selectable","description","descriptions"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"props"),r.arr.forEach(t=>{m(t.key,t.value)})}function y(e){let s=["slot","name","selectable","description","descriptions"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"slot"),r.arr.forEach(t=>{m(t.key,t.value)})}function w(e){let s=["emits","name","selectable","description","descriptions"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"emits"),r.arr.forEach(t=>{m(t.key,t.value)})}function k(e){let s=["expose","name","type","selectable","description","descriptions"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"expose"),r.arr.forEach(t=>{m(t.key,t.value)})}function p(e,s){var o;const r=c[s+"name"]||[],l=e.name??((o=e[s])==null?void 0:o.name),t=r.indexOf(l);t>=0&&(c[s+"s"].splice(t,1),r.splice(t,1)),c[s+"s"].push(e),r.push(l),c[s+"name"]=r}function N(){Object.keys(c).forEach(e=>{c[e]=[]})}function u(e,s){var t;const r={descriptions:(e==null?void 0:e.description)||""},l=[];return e!=null&&e.tags&&((t=e==null?void 0:e.tags)==null||t.forEach(o=>{let i=o.tag,n=E(o);if(!r.hasOwnProperty(i))r[i]=n;else{const f={};f[i]=n,l.push({key:i,value:f})}})),{arr:l,obj:r}}function m(e,s){switch(e){case"title":return g(s),!0;case"text":return g(s),!0;case"props":return p(s,"props"),!0;case"slot":return p(s,"slot"),!0;case"emits":return p(s,"emits"),!0;case"expose":return p(s,"expose"),!0;default:return!1}}function P(e,s){switch(e){case"title":return O(s),!0;case"props":return T(s),!0;case"slot":return y(s),!0;case"emits":return w(s),!0;case"expose":return k(s),!0;default:return!1}}function S(e){return N(),e==null||e.forEach(s=>{let r=(s==null?void 0:s.tags)||[],l=(r==null?void 0:r.length)||0;if(l>0)for(let t=0;t<l;t++){const o=r[t]||{};if(P(o.tag,s))break}}),c}function q(e){let s=b.getTextNotes(e);return S(s)}const F=[{label:"属性名",prop:"name",formatter:a.props.name},{label:"说明",prop:"description",formatter:a.props.description},{label:"类型",prop:"type",formatter:a.props.type},{label:"可选值",prop:"selectable",formatter:a.props.selectable},{label:"默认值",prop:"default",formatter:a.props.default}],v=[{label:"事件名",prop:"name",formatter:a.emits.name},{label:"说明",prop:"description",formatter:a.emits.description},{label:"回调参数",prop:"selectable",formatter:a.emits.selectable}],z=[{label:"方法名",prop:"name",formatter:a.expose.name},{label:"说明",prop:"description",formatter:a.expose.description},{label:"参数",prop:"selectable",formatter:a.expose.selectable},{label:"返回值",prop:"type",formatter:a.expose.type}],A=[{label:"插槽名",prop:"name",formatter:a.slot.name},{label:"说明",prop:"description",formatter:a.slot.description},{label:"作用域参数",prop:"selectable",formatter:a.slot.selectable}];exports.getNotesText=q;exports.temits=v;exports.texpose=z;exports.tprops=F;exports.tslot=A;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { getKeyMds } from '../../utils/glob';
|
|
2
2
|
import type { SpecObjs } from '../../utils/index';
|
|
3
|
-
type NotesObj = {
|
|
3
|
+
export type NotesObj = {
|
|
4
4
|
titles: SpecObjs[];
|
|
5
5
|
propss: SpecObjs[];
|
|
6
6
|
slots: SpecObjs[];
|
|
@@ -9,6 +9,7 @@ type NotesObj = {
|
|
|
9
9
|
[key: string]: any[];
|
|
10
10
|
};
|
|
11
11
|
export declare function getNotes(key: string): Promise<NotesObj>;
|
|
12
|
+
export declare function getNotesText(text: string): NotesObj;
|
|
12
13
|
export type FTableFormatter = (data: SpecObjs, item?: FTableList, index?: number, key?: number) => string;
|
|
13
14
|
export type FTableList = {
|
|
14
15
|
label: string;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { getTextNotes as
|
|
2
|
-
import { getLocalTextComponents as T } from "../../utils/glob.js";
|
|
3
|
-
import { getKeyMds as H } from "../../utils/glob.js";
|
|
1
|
+
import { getTextNotes as T } from "../../utils/index.js";
|
|
4
2
|
import { props as f, emits as h, expose as d, slot as x } from "../../utils/props.js";
|
|
5
3
|
const c = {
|
|
6
4
|
titles: [],
|
|
@@ -17,17 +15,17 @@ function O(e, s) {
|
|
|
17
15
|
["(", ")"],
|
|
18
16
|
["{", "}"],
|
|
19
17
|
["[", "]"]
|
|
20
|
-
], a = l.map((
|
|
18
|
+
], a = l.map((o) => o[0]).indexOf(r);
|
|
21
19
|
if (a != -1) {
|
|
22
|
-
let
|
|
20
|
+
let n = new RegExp(
|
|
23
21
|
"^" + l[a][0] + "((.|\\n|\\r)+?)" + l[a][1] + (s ? "\\s" : ""),
|
|
24
22
|
"gi"
|
|
25
23
|
).exec(e);
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
24
|
+
if (n)
|
|
25
|
+
return n[0];
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
|
-
function
|
|
28
|
+
function y(e) {
|
|
31
29
|
delete e.problems, delete e.source;
|
|
32
30
|
let s = e.tag, r = e.name, l = e.description, t = e.default, a = "";
|
|
33
31
|
if (s == "default")
|
|
@@ -41,12 +39,12 @@ function w(e) {
|
|
|
41
39
|
const E = p[1] + " " + l, g = O(E, !0);
|
|
42
40
|
g ? (t = g, l = E.replace(g, "")) : t = e.default || p[1] || "";
|
|
43
41
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
42
|
+
const n = /\s*\((.*)\)\s/gi.exec(l);
|
|
43
|
+
n && n.length > 0 && (a = n[1], l = l.replace(n[0], ""));
|
|
46
44
|
}
|
|
47
45
|
return e.name = r, e.default = t || "", e.description = l, e.selectable = a, e;
|
|
48
46
|
}
|
|
49
|
-
function
|
|
47
|
+
function w(e) {
|
|
50
48
|
let s = [
|
|
51
49
|
"title",
|
|
52
50
|
// 'name',
|
|
@@ -65,7 +63,7 @@ function k(e) {
|
|
|
65
63
|
function b(e) {
|
|
66
64
|
c.titles.push(e);
|
|
67
65
|
}
|
|
68
|
-
function
|
|
66
|
+
function k(e) {
|
|
69
67
|
let s = [
|
|
70
68
|
"props",
|
|
71
69
|
"name",
|
|
@@ -109,7 +107,7 @@ function N(e) {
|
|
|
109
107
|
m(t.key, t.value);
|
|
110
108
|
});
|
|
111
109
|
}
|
|
112
|
-
function
|
|
110
|
+
function P(e) {
|
|
113
111
|
let s = [
|
|
114
112
|
"expose",
|
|
115
113
|
"name",
|
|
@@ -129,7 +127,7 @@ function i(e, s) {
|
|
|
129
127
|
const r = c[s + "name"] || [], l = e.name ?? ((a = e[s]) == null ? void 0 : a.name), t = r.indexOf(l);
|
|
130
128
|
t >= 0 && (c[s + "s"].splice(t, 1), r.splice(t, 1)), c[s + "s"].push(e), r.push(l), c[s + "name"] = r;
|
|
131
129
|
}
|
|
132
|
-
function
|
|
130
|
+
function z() {
|
|
133
131
|
Object.keys(c).forEach((e) => {
|
|
134
132
|
c[e] = [];
|
|
135
133
|
});
|
|
@@ -140,13 +138,13 @@ function u(e, s) {
|
|
|
140
138
|
descriptions: (e == null ? void 0 : e.description) || ""
|
|
141
139
|
}, l = [];
|
|
142
140
|
return e != null && e.tags && ((t = e == null ? void 0 : e.tags) == null || t.forEach((a) => {
|
|
143
|
-
let
|
|
144
|
-
if (!r.hasOwnProperty(
|
|
145
|
-
r[
|
|
141
|
+
let o = a.tag, n = y(a);
|
|
142
|
+
if (!r.hasOwnProperty(o))
|
|
143
|
+
r[o] = n;
|
|
146
144
|
else {
|
|
147
145
|
const p = {};
|
|
148
|
-
p[
|
|
149
|
-
key:
|
|
146
|
+
p[o] = n, l.push({
|
|
147
|
+
key: o,
|
|
150
148
|
value: p
|
|
151
149
|
});
|
|
152
150
|
}
|
|
@@ -173,42 +171,38 @@ function m(e, s) {
|
|
|
173
171
|
return !1;
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
|
-
function
|
|
174
|
+
function A(e, s) {
|
|
177
175
|
switch (e) {
|
|
178
176
|
case "title":
|
|
179
|
-
return
|
|
177
|
+
return w(s), !0;
|
|
180
178
|
case "props":
|
|
181
|
-
return
|
|
179
|
+
return k(s), !0;
|
|
182
180
|
case "slot":
|
|
183
181
|
return F(s), !0;
|
|
184
182
|
case "emits":
|
|
185
183
|
return N(s), !0;
|
|
186
184
|
case "expose":
|
|
187
|
-
return
|
|
185
|
+
return P(s), !0;
|
|
188
186
|
default:
|
|
189
187
|
return !1;
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
190
|
function D(e) {
|
|
193
|
-
return
|
|
191
|
+
return z(), e == null || e.forEach((s) => {
|
|
194
192
|
let r = (s == null ? void 0 : s.tags) || [], l = (r == null ? void 0 : r.length) || 0;
|
|
195
193
|
if (l > 0)
|
|
196
194
|
for (let t = 0; t < l; t++) {
|
|
197
195
|
const a = r[t] || {};
|
|
198
|
-
if (
|
|
196
|
+
if (A(a.tag, s))
|
|
199
197
|
break;
|
|
200
198
|
}
|
|
201
199
|
}), c;
|
|
202
200
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
let l = y(r);
|
|
207
|
-
s(D(l));
|
|
208
|
-
});
|
|
209
|
-
});
|
|
201
|
+
function _(e) {
|
|
202
|
+
let s = T(e);
|
|
203
|
+
return D(s);
|
|
210
204
|
}
|
|
211
|
-
const
|
|
205
|
+
const q = [
|
|
212
206
|
{
|
|
213
207
|
label: "属性名",
|
|
214
208
|
prop: "name",
|
|
@@ -234,7 +228,7 @@ const S = [
|
|
|
234
228
|
prop: "default",
|
|
235
229
|
formatter: f.default
|
|
236
230
|
}
|
|
237
|
-
],
|
|
231
|
+
], v = [
|
|
238
232
|
{
|
|
239
233
|
label: "事件名",
|
|
240
234
|
prop: "name",
|
|
@@ -250,7 +244,7 @@ const S = [
|
|
|
250
244
|
prop: "selectable",
|
|
251
245
|
formatter: h.selectable
|
|
252
246
|
}
|
|
253
|
-
],
|
|
247
|
+
], B = [
|
|
254
248
|
{
|
|
255
249
|
label: "方法名",
|
|
256
250
|
prop: "name",
|
|
@@ -271,7 +265,7 @@ const S = [
|
|
|
271
265
|
prop: "type",
|
|
272
266
|
formatter: d.type
|
|
273
267
|
}
|
|
274
|
-
],
|
|
268
|
+
], C = [
|
|
275
269
|
{
|
|
276
270
|
label: "插槽名",
|
|
277
271
|
prop: "name",
|
|
@@ -289,10 +283,9 @@ const S = [
|
|
|
289
283
|
}
|
|
290
284
|
];
|
|
291
285
|
export {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
q as
|
|
296
|
-
|
|
297
|
-
v as tslot
|
|
286
|
+
_ as getNotesText,
|
|
287
|
+
v as temits,
|
|
288
|
+
B as texpose,
|
|
289
|
+
q as tprops,
|
|
290
|
+
C as tslot
|
|
298
291
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),d=require("../use/index.cjs"),k=require("./info.vue.cjs"),f=require("./props.vue.cjs"),g=require("../../config.cjs"),B=require("../md/index.vue.cjs");require("./index.cjs");const v=require("../../utils/glob.cjs"),y={class:"compo"},q={key:0,class:"compo-md"},C={key:0,class:"compo-md-list"},h={key:1,class:"compo-use"},x=e.defineComponent({__name:"index",props:{value:Object},setup(l){const t=l,m=g.getConfig("useparam"),a=e.ref(""),r=e.reactive({md:!0}),c=e.ref([]),s=e.ref({});function p(o){s.value=o}e.watch(()=>t.value,()=>{i()});function i(){var o,n,u;(o=t.value)!=null&&o.key&&(v.getLocalTextComponents((n=t.value)==null?void 0:n.key).then(_=>{a.value=_}),c.value=v.getKeyMds((u=t.value)==null?void 0:u.key)||[])}return i(),(o,n)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(k,{value:l.value},null,8,["value"]),e.createVNode(f,{onChange:p,value:a.value},null,8,["value"]),c.value&&c.value.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",{onClick:n[0]||(n[0]=u=>r.md=!r.md),class:"compo-md-name"}," 说明文档 "),r.md?(e.openBlock(),e.createElementBlock("div",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createBlock(B,{value:u},null,8,["value"]))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createElementBlock("div",h,[e.createVNode(e.unref(d),{value:t.value,param:e.unref(s)},null,8,["value","param"])])):e.createCommentVNode("",!0)]))}});module.exports=x;
|
|
@@ -1,115 +1,70 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getKeyMds as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as h, ref as s, reactive as y, watch as C, openBlock as e, createElementBlock as l, createVNode as u, createElementVNode as x, Fragment as $, renderList as B, createBlock as N, createCommentVNode as c, unref as i } from "vue";
|
|
2
|
+
import V from "../use/index.js";
|
|
3
|
+
import b from "./info.vue.js";
|
|
4
|
+
import j from "./props.vue.js";
|
|
5
|
+
import { getConfig as E } from "../../config.js";
|
|
6
|
+
import L from "../md/index.vue.js";
|
|
7
|
+
import "./index.js";
|
|
8
|
+
import { getLocalTextComponents as w, getKeyMds as D } from "../../utils/glob.js";
|
|
9
|
+
const F = { class: "compo" }, K = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "compo-md"
|
|
12
|
-
},
|
|
12
|
+
}, M = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "compo-md-list"
|
|
15
|
-
},
|
|
15
|
+
}, O = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "compo-use"
|
|
18
|
+
}, J = /* @__PURE__ */ h({
|
|
16
19
|
__name: "index",
|
|
17
20
|
props: {
|
|
18
21
|
value: Object
|
|
19
22
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
w(
|
|
30
|
-
() => m.value,
|
|
23
|
+
setup(v) {
|
|
24
|
+
const t = v, _ = E("useparam"), p = s(""), r = y({
|
|
25
|
+
md: !0
|
|
26
|
+
}), m = s([]), d = s({});
|
|
27
|
+
function k(o) {
|
|
28
|
+
d.value = o;
|
|
29
|
+
}
|
|
30
|
+
C(
|
|
31
|
+
() => t.value,
|
|
31
32
|
() => {
|
|
32
|
-
|
|
33
|
+
f();
|
|
33
34
|
}
|
|
34
35
|
);
|
|
35
|
-
function
|
|
36
|
-
var
|
|
37
|
-
(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
function f() {
|
|
37
|
+
var o, a, n;
|
|
38
|
+
(o = t.value) != null && o.key && (w((a = t.value) == null ? void 0 : a.key).then(
|
|
39
|
+
(g) => {
|
|
40
|
+
p.value = g;
|
|
41
|
+
}
|
|
42
|
+
), m.value = D((n = t.value) == null ? void 0 : n.key) || []);
|
|
41
43
|
}
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
o("h4", {
|
|
52
|
-
onClick: t[0] || (t[0] = (l) => e.props = !e.props)
|
|
53
|
-
}, " 组件属性 "),
|
|
54
|
-
e.props ? (s(), a(r, {
|
|
55
|
-
key: 0,
|
|
56
|
-
list: v(U),
|
|
57
|
-
value: c.value
|
|
58
|
-
}, null, 8, ["list", "value"])) : u("", !0)
|
|
59
|
-
]),
|
|
60
|
-
o("div", P, [
|
|
61
|
-
o("h4", {
|
|
62
|
-
onClick: t[1] || (t[1] = (l) => e.emits = !e.emits)
|
|
63
|
-
}, " 组件事件 "),
|
|
64
|
-
e.emits ? (s(), a(r, {
|
|
65
|
-
key: 0,
|
|
66
|
-
list: v(q),
|
|
67
|
-
value: d.value
|
|
68
|
-
}, null, 8, ["list", "value"])) : u("", !0)
|
|
69
|
-
]),
|
|
70
|
-
o("div", Q, [
|
|
71
|
-
o("h4", {
|
|
72
|
-
onClick: t[2] || (t[2] = (l) => e.expose = !e.expose)
|
|
73
|
-
}, " 组件方法 "),
|
|
74
|
-
e.expose ? (s(), a(r, {
|
|
75
|
-
key: 0,
|
|
76
|
-
list: v(z),
|
|
77
|
-
value: f.value
|
|
78
|
-
}, null, 8, ["list", "value"])) : u("", !0)
|
|
79
|
-
]),
|
|
80
|
-
o("div", R, [
|
|
81
|
-
o("h4", {
|
|
82
|
-
onClick: t[3] || (t[3] = (l) => e.slot = !e.slot)
|
|
83
|
-
}, "组件插槽"),
|
|
84
|
-
e.slot ? (s(), a(r, {
|
|
85
|
-
key: 0,
|
|
86
|
-
list: v(A),
|
|
87
|
-
value: k.value
|
|
88
|
-
}, null, 8, ["list", "value"])) : u("", !0)
|
|
89
|
-
]),
|
|
90
|
-
n.value && n.value.length ? (s(), p("div", S, [
|
|
91
|
-
o("div", {
|
|
92
|
-
onClick: t[4] || (t[4] = (l) => e.md = !e.md),
|
|
44
|
+
return f(), (o, a) => (e(), l("div", F, [
|
|
45
|
+
u(b, { value: v.value }, null, 8, ["value"]),
|
|
46
|
+
u(j, {
|
|
47
|
+
onChange: k,
|
|
48
|
+
value: p.value
|
|
49
|
+
}, null, 8, ["value"]),
|
|
50
|
+
m.value && m.value.length ? (e(), l("div", K, [
|
|
51
|
+
x("div", {
|
|
52
|
+
onClick: a[0] || (a[0] = (n) => r.md = !r.md),
|
|
93
53
|
class: "compo-md-name"
|
|
94
54
|
}, " 说明文档 "),
|
|
95
|
-
|
|
96
|
-
(
|
|
97
|
-
])) :
|
|
98
|
-
])) :
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
value:
|
|
102
|
-
param:
|
|
103
|
-
props: c.value,
|
|
104
|
-
slot: k.value,
|
|
105
|
-
emits: d.value,
|
|
106
|
-
expose: f.value
|
|
107
|
-
}
|
|
55
|
+
r.md ? (e(), l("div", M, [
|
|
56
|
+
(e(!0), l($, null, B(m.value, (n) => (e(), N(L, { value: n }, null, 8, ["value"]))), 256))
|
|
57
|
+
])) : c("", !0)
|
|
58
|
+
])) : c("", !0),
|
|
59
|
+
i(_) ? (e(), l("div", O, [
|
|
60
|
+
u(i(V), {
|
|
61
|
+
value: t.value,
|
|
62
|
+
param: i(d)
|
|
108
63
|
}, null, 8, ["value", "param"])
|
|
109
|
-
])
|
|
64
|
+
])) : c("", !0)
|
|
110
65
|
]));
|
|
111
66
|
}
|
|
112
67
|
});
|
|
113
68
|
export {
|
|
114
|
-
|
|
69
|
+
J as default
|
|
115
70
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),f=require("./top.cjs"),n=require("./ftable.vue.cjs"),s=require("./index.cjs"),N={class:"compo-top"},_={class:"compo-li compo-props"},V={class:"compo-li compo-emits"},x={class:"compo-li compo-expose"},B={class:"compo-li compo-slot"},C=e.defineComponent({__name:"props",props:{value:String},emits:["change"],setup(d,{emit:k}){const r=d,u=e.ref([]),t=e.reactive({props:!0,expose:!0,emits:!0,slot:!0,top:!0}),p=e.ref([]),a=e.ref([]),i=e.ref([]),v=e.ref([]);function m(){if(r.value){const l=s.getNotesText(r.value);u.value=l.titles,p.value=l.propss,v.value=l.slots,a.value=l.emitss,i.value=l.exposes,k("change",l)}}return e.watch(()=>r.value,()=>{m()}),m(),(l,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",N,[t.top?(e.openBlock(),e.createBlock(e.unref(f.default),{key:0,value:u.value},null,8,["value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_,[e.createElementVNode("h4",{onClick:o[0]||(o[0]=c=>t.props=!t.props)}," 组件属性 "),t.props?(e.openBlock(),e.createBlock(n,{key:0,list:e.unref(s.tprops),value:p.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",V,[e.createElementVNode("h4",{onClick:o[1]||(o[1]=c=>t.emits=!t.emits)}," 组件事件 "),t.emits?(e.openBlock(),e.createBlock(n,{key:0,list:e.unref(s.temits),value:a.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",x,[e.createElementVNode("h4",{onClick:o[2]||(o[2]=c=>t.expose=!t.expose)}," 组件方法 "),t.expose?(e.openBlock(),e.createBlock(n,{key:0,list:e.unref(s.texpose),value:i.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",B,[e.createElementVNode("h4",{onClick:o[3]||(o[3]=c=>t.slot=!t.slot)},"组件插槽"),t.slot?(e.openBlock(),e.createBlock(n,{key:0,list:e.unref(s.tslot),value:v.value},null,8,["list","value"])):e.createCommentVNode("",!0)])]))}});module.exports=C;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _sfc_main: import('./vue/dist/vue.esm-bundler.js').DefineComponent<{
|
|
2
|
+
value: StringConstructor;
|
|
3
|
+
}, {}, unknown, {}, {}, import('./vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('./vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, "change"[], "change", import('./vue/dist/vue.esm-bundler.js').VNodeProps & import('./vue/dist/vue.esm-bundler.js').AllowedComponentProps & import('./vue/dist/vue.esm-bundler.js').ComponentCustomProps, Readonly<import('./vue/dist/vue.esm-bundler.js').ExtractPropTypes<{
|
|
4
|
+
value: StringConstructor;
|
|
5
|
+
}>> & {
|
|
6
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
7
|
+
}, {}>;
|
|
8
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as g, ref as p, reactive as h, watch as y, openBlock as l, createElementBlock as $, createElementVNode as t, createBlock as i, unref as n, createCommentVNode as u } from "vue";
|
|
2
|
+
import B from "./top.js";
|
|
3
|
+
import r from "./ftable.vue.js";
|
|
4
|
+
import { tprops as N, temits as E, texpose as T, tslot as V, getNotesText as b } from "./index.js";
|
|
5
|
+
const j = { class: "compo-top" }, w = { class: "compo-li compo-props" }, D = { class: "compo-li compo-emits" }, S = { class: "compo-li compo-expose" }, q = { class: "compo-li compo-slot" }, H = /* @__PURE__ */ g({
|
|
6
|
+
__name: "props",
|
|
7
|
+
props: {
|
|
8
|
+
value: String
|
|
9
|
+
},
|
|
10
|
+
emits: ["change"],
|
|
11
|
+
setup(_, { emit: C }) {
|
|
12
|
+
const v = _, m = p([]), e = h({
|
|
13
|
+
props: !0,
|
|
14
|
+
expose: !0,
|
|
15
|
+
emits: !0,
|
|
16
|
+
slot: !0,
|
|
17
|
+
top: !0
|
|
18
|
+
}), c = p([]), d = p([]), f = p([]), k = p([]);
|
|
19
|
+
function x() {
|
|
20
|
+
if (v.value) {
|
|
21
|
+
const s = b(v.value);
|
|
22
|
+
m.value = s.titles, c.value = s.propss, k.value = s.slots, d.value = s.emitss, f.value = s.exposes, C("change", s);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return y(
|
|
26
|
+
() => v.value,
|
|
27
|
+
() => {
|
|
28
|
+
x();
|
|
29
|
+
}
|
|
30
|
+
), x(), (s, o) => (l(), $("div", null, [
|
|
31
|
+
t("div", j, [
|
|
32
|
+
e.top ? (l(), i(n(B), {
|
|
33
|
+
key: 0,
|
|
34
|
+
value: m.value
|
|
35
|
+
}, null, 8, ["value"])) : u("", !0)
|
|
36
|
+
]),
|
|
37
|
+
t("div", w, [
|
|
38
|
+
t("h4", {
|
|
39
|
+
onClick: o[0] || (o[0] = (a) => e.props = !e.props)
|
|
40
|
+
}, " 组件属性 "),
|
|
41
|
+
e.props ? (l(), i(r, {
|
|
42
|
+
key: 0,
|
|
43
|
+
list: n(N),
|
|
44
|
+
value: c.value
|
|
45
|
+
}, null, 8, ["list", "value"])) : u("", !0)
|
|
46
|
+
]),
|
|
47
|
+
t("div", D, [
|
|
48
|
+
t("h4", {
|
|
49
|
+
onClick: o[1] || (o[1] = (a) => e.emits = !e.emits)
|
|
50
|
+
}, " 组件事件 "),
|
|
51
|
+
e.emits ? (l(), i(r, {
|
|
52
|
+
key: 0,
|
|
53
|
+
list: n(E),
|
|
54
|
+
value: d.value
|
|
55
|
+
}, null, 8, ["list", "value"])) : u("", !0)
|
|
56
|
+
]),
|
|
57
|
+
t("div", S, [
|
|
58
|
+
t("h4", {
|
|
59
|
+
onClick: o[2] || (o[2] = (a) => e.expose = !e.expose)
|
|
60
|
+
}, " 组件方法 "),
|
|
61
|
+
e.expose ? (l(), i(r, {
|
|
62
|
+
key: 0,
|
|
63
|
+
list: n(T),
|
|
64
|
+
value: f.value
|
|
65
|
+
}, null, 8, ["list", "value"])) : u("", !0)
|
|
66
|
+
]),
|
|
67
|
+
t("div", q, [
|
|
68
|
+
t("h4", {
|
|
69
|
+
onClick: o[3] || (o[3] = (a) => e.slot = !e.slot)
|
|
70
|
+
}, "组件插槽"),
|
|
71
|
+
e.slot ? (l(), i(r, {
|
|
72
|
+
key: 0,
|
|
73
|
+
list: n(V),
|
|
74
|
+
value: k.value
|
|
75
|
+
}, null, 8, ["list", "value"])) : u("", !0)
|
|
76
|
+
])
|
|
77
|
+
]));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
H as default
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./props.vue.cjs");module.exports=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),f=require("../boxurl/index.vue.cjs"),x=require("./top.cjs"),h=require("../code/index.vue.cjs"),y=require("./index.cjs"),N=require("../../utils/glob.cjs"),
|
|
1
|
+
"use strict";const e=require("vue"),f=require("../boxurl/index.vue.cjs"),x=require("./top.cjs"),h=require("../code/index.vue.cjs"),y=require("./index.cjs"),N=require("../../utils/glob.cjs"),k={class:"md-top-name"},V={class:"test-top"},g={class:"test-div"},B={class:"test-body"},C={key:0,class:"test-code"},q=e.defineComponent({__name:"index",props:{value:Object,read:{type:Boolean,default:!0}},emits:["state"],setup(v,{emit:_}){const t=v,o=e.ref(""),u=e.ref([]),s=e.ref("1");e.watch([()=>t.value,()=>t.read],()=>{i()});let r;function i(){var l,n;t.read&&(l=t.value)!=null&&l.key&&N.getLocalTextTests(t.value).then(a=>{var d;o.value=a;let{titles:p,states:m}=y.getNotes(a);u.value=p;const c=m[0];c&&c.type&&(s.value=c.type.type),_("state",s.value,(d=t.value)==null?void 0:d.key)}).catch(()=>{o.value=""}),(n=t.value)!=null&&n.component&&(r=e.defineAsyncComponent(t.value.component))}return i(),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["test","state-"+s.value])},[e.createVNode(f,{value:t.value},{default:e.withCtx(()=>{var a;return[e.createElementVNode("div",k,e.toDisplayString((a=t.value)==null?void 0:a.value)+" 文件 示例代码 ",1)]}),_:1},8,["value"]),e.createElementVNode("div",V,[e.createVNode(e.unref(x.default),{value:u.value},null,8,["value"])]),e.createElementVNode("div",g,[e.createElementVNode("div",B,[(e.openBlock(),e.createBlock(e.Suspense,null,{fallback:e.withCtx(()=>[e.createTextVNode(" 示例加载中... ")]),default:e.withCtx(()=>[e.createVNode(e.unref(r))]),_:1}))]),t.read?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(h,{value:t.value,text:o.value},null,8,["value","text"])])):e.createCommentVNode("",!0)])],2))}});module.exports=q;
|