br-dionysus 0.0.1

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.
Files changed (66) hide show
  1. package/.idea/dionysus.iml +12 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/vcs.xml +6 -0
  4. package/LICENSE +21 -0
  5. package/README.md +0 -0
  6. package/build/base.config.ts +20 -0
  7. package/build/doc.config.ts +10 -0
  8. package/build/lib.config.ts +31 -0
  9. package/dist/index.css +1 -0
  10. package/dist/my-kit.es.js +254 -0
  11. package/dist/my-kit.umd.js +2 -0
  12. package/dist/packages/Button/index.d.ts +4 -0
  13. package/dist/packages/Button/src/index.vue.d.ts +4 -0
  14. package/dist/packages/Foo/index.d.ts +4 -0
  15. package/dist/packages/TabPage/index.d.ts +4 -0
  16. package/dist/packages/TabPage/src/index.vue.d.ts +70 -0
  17. package/dist/packages/index.d.ts +11 -0
  18. package/dist/src/env.d.ts +11 -0
  19. package/docs/assets/README.04f9b87a.js +1 -0
  20. package/docs/assets/README.e027c703.js +1 -0
  21. package/docs/assets/index.55b9c1a5.js +1 -0
  22. package/docs/assets/index.f005ac77.css +1 -0
  23. package/docs/assets/vendor.234e3e3c.js +12 -0
  24. package/docs/index.html +16 -0
  25. package/docs/packages/Button/docs/README.md +9 -0
  26. package/docs/packages/Button/docs/demo.vue +11 -0
  27. package/docs/packages/Button/index.ts +10 -0
  28. package/docs/packages/Button/src/index.vue +26 -0
  29. package/docs/packages/Foo/docs/README.md +28 -0
  30. package/docs/packages/Foo/docs/demo.vue +5 -0
  31. package/docs/packages/Foo/index.ts +12 -0
  32. package/docs/packages/Foo/src/index.vue +15 -0
  33. package/docs/packages/index.ts +23 -0
  34. package/docs/packages/list.json +14 -0
  35. package/index.html +13 -0
  36. package/package.json +30 -0
  37. package/packages/Button/docs/README.md +9 -0
  38. package/packages/Button/docs/demo.vue +11 -0
  39. package/packages/Button/index.ts +10 -0
  40. package/packages/Button/src/index.vue +26 -0
  41. package/packages/Foo/docs/README.md +28 -0
  42. package/packages/Foo/docs/demo.vue +5 -0
  43. package/packages/Foo/index.ts +12 -0
  44. package/packages/Foo/src/index.vue +15 -0
  45. package/packages/TabPage/index.ts +10 -0
  46. package/packages/TabPage/src/index.vue +499 -0
  47. package/packages/index.ts +26 -0
  48. package/packages/list.json +20 -0
  49. package/script/copyDir.js +7 -0
  50. package/script/genNewComp/.template/docs/README.md.tpl +28 -0
  51. package/script/genNewComp/.template/docs/demo.vue.tpl +5 -0
  52. package/script/genNewComp/.template/index.ts.tpl +12 -0
  53. package/script/genNewComp/.template/install.ts.tpl +20 -0
  54. package/script/genNewComp/.template/router.ts.tpl +25 -0
  55. package/script/genNewComp/.template/src/index.vue.tpl +15 -0
  56. package/script/genNewComp/index.js +9 -0
  57. package/script/genNewComp/infoCollector.js +63 -0
  58. package/script/genNewComp/tplReplacer.js +95 -0
  59. package/src/App.vue +46 -0
  60. package/src/assets/markdown.css +273 -0
  61. package/src/assets/prism.css +429 -0
  62. package/src/components/Preview.vue +101 -0
  63. package/src/env.d.ts +11 -0
  64. package/src/main.ts +12 -0
  65. package/src/router.ts +35 -0
  66. package/tsconfig.json +30 -0
@@ -0,0 +1,429 @@
1
+ /**
2
+ * One Light theme for prism.js
3
+ * Based on Atom's One Light theme: https://github.com/atom/atom/tree/master/packages/one-light-syntax
4
+ */
5
+
6
+ /**
7
+ * One Light colours (accurate as of commit eb064bf on 19 Feb 2021)
8
+ * From colors.less
9
+ * --mono-1: hsl(230, 8%, 24%);
10
+ * --mono-2: hsl(230, 6%, 44%);
11
+ * --mono-3: hsl(230, 4%, 64%)
12
+ * --hue-1: hsl(198, 99%, 37%);
13
+ * --hue-2: hsl(221, 87%, 60%);
14
+ * --hue-3: hsl(301, 63%, 40%);
15
+ * --hue-4: hsl(119, 34%, 47%);
16
+ * --hue-5: hsl(5, 74%, 59%);
17
+ * --hue-5-2: hsl(344, 84%, 43%);
18
+ * --hue-6: hsl(35, 99%, 36%);
19
+ * --hue-6-2: hsl(35, 99%, 40%);
20
+ * --syntax-fg: hsl(230, 8%, 24%);
21
+ * --syntax-bg: hsl(230, 1%, 98%);
22
+ * --syntax-gutter: hsl(230, 1%, 62%);
23
+ * --syntax-guide: hsla(230, 8%, 24%, 0.2);
24
+ * --syntax-accent: hsl(230, 100%, 66%);
25
+ * From syntax-variables.less
26
+ * --syntax-selection-color: hsl(230, 1%, 90%);
27
+ * --syntax-gutter-background-color-selected: hsl(230, 1%, 90%);
28
+ * --syntax-cursor-line: hsla(230, 8%, 24%, 0.05);
29
+ */
30
+
31
+ code[class*="language-"],
32
+ pre[class*="language-"] {
33
+ padding: 0;
34
+ background: hsl(230, 1%, 98%);
35
+ color: hsl(230, 8%, 24%);
36
+ font-family: "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
37
+ direction: ltr;
38
+ text-align: left;
39
+ white-space: pre;
40
+ word-spacing: normal;
41
+ word-break: normal;
42
+ line-height: 1.5;
43
+ -moz-tab-size: 2;
44
+ -o-tab-size: 2;
45
+ tab-size: 2;
46
+ -webkit-hyphens: none;
47
+ -moz-hyphens: none;
48
+ -ms-hyphens: none;
49
+ hyphens: none;
50
+ }
51
+
52
+ /* Selection */
53
+ code[class*="language-"]::-moz-selection,
54
+ code[class*="language-"] *::-moz-selection,
55
+ pre[class*="language-"] *::-moz-selection {
56
+ background: hsl(230, 1%, 90%);
57
+ color: inherit;
58
+ }
59
+
60
+ code[class*="language-"]::selection,
61
+ code[class*="language-"] *::selection,
62
+ pre[class*="language-"] *::selection {
63
+ background: hsl(230, 1%, 90%);
64
+ color: inherit;
65
+ }
66
+
67
+ /* Code blocks */
68
+ pre[class*="language-"] {
69
+ padding: 1em;
70
+ margin: 0.5em 0;
71
+ overflow: auto;
72
+ border-radius: 0.3em;
73
+ }
74
+
75
+ /* Inline code */
76
+ :not(pre) > code[class*="language-"] {
77
+ padding: 0.2em 0.3em;
78
+ border-radius: 0.3em;
79
+ white-space: normal;
80
+ }
81
+
82
+ .token.comment,
83
+ .token.prolog,
84
+ .token.cdata {
85
+ color: hsl(230, 4%, 64%);
86
+ }
87
+
88
+ .token.doctype,
89
+ .token.punctuation,
90
+ .token.entity {
91
+ color: hsl(230, 8%, 24%);
92
+ }
93
+
94
+ .token.attr-name,
95
+ .token.class-name,
96
+ .token.boolean,
97
+ .token.constant,
98
+ .token.number,
99
+ .token.atrule {
100
+ color: hsl(35, 99%, 36%);
101
+ }
102
+
103
+ .token.keyword {
104
+ color: hsl(301, 63%, 40%);
105
+ }
106
+
107
+ .token.property,
108
+ .token.tag,
109
+ .token.symbol,
110
+ .token.deleted,
111
+ .token.important {
112
+ color: hsl(5, 74%, 59%);
113
+ }
114
+
115
+ .token.selector,
116
+ .token.string,
117
+ .token.char,
118
+ .token.builtin,
119
+ .token.inserted,
120
+ .token.regex,
121
+ .token.attr-value,
122
+ .token.attr-value > .token.punctuation {
123
+ color: hsl(119, 34%, 47%);
124
+ }
125
+
126
+ .token.variable,
127
+ .token.operator,
128
+ .token.function {
129
+ color: hsl(221, 87%, 60%);
130
+ }
131
+
132
+ .token.url {
133
+ color: hsl(198, 99%, 37%);
134
+ }
135
+
136
+ /* HTML overrides */
137
+ .token.attr-value > .token.punctuation.attr-equals,
138
+ .token.special-attr > .token.attr-value > .token.value.css {
139
+ color: hsl(230, 8%, 24%);
140
+ }
141
+
142
+ /* CSS overrides */
143
+ .language-css .token.selector {
144
+ color: hsl(5, 74%, 59%);
145
+ }
146
+
147
+ .language-css .token.property {
148
+ color: hsl(230, 8%, 24%);
149
+ }
150
+
151
+ .language-css .token.function,
152
+ .language-css .token.url > .token.function {
153
+ color: hsl(198, 99%, 37%);
154
+ }
155
+
156
+ .language-css .token.url > .token.string.url {
157
+ color: hsl(119, 34%, 47%);
158
+ }
159
+
160
+ .language-css .token.important,
161
+ .language-css .token.atrule .token.rule {
162
+ color: hsl(301, 63%, 40%);
163
+ }
164
+
165
+ /* JS overrides */
166
+ .language-javascript .token.operator {
167
+ color: hsl(301, 63%, 40%);
168
+ }
169
+
170
+ .language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation {
171
+ color: hsl(344, 84%, 43%);
172
+ }
173
+
174
+ /* JSON overrides */
175
+ .language-json .token.operator {
176
+ color: hsl(230, 8%, 24%);
177
+ }
178
+
179
+ .language-json .token.null.keyword {
180
+ color: hsl(35, 99%, 36%);
181
+ }
182
+
183
+ /* MD overrides */
184
+ .language-markdown .token.url,
185
+ .language-markdown .token.url > .token.operator,
186
+ .language-markdown .token.url-reference.url > .token.string {
187
+ color: hsl(230, 8%, 24%);
188
+ }
189
+
190
+ .language-markdown .token.url > .token.content {
191
+ color: hsl(221, 87%, 60%);
192
+ }
193
+
194
+ .language-markdown .token.url > .token.url,
195
+ .language-markdown .token.url-reference.url {
196
+ color: hsl(198, 99%, 37%);
197
+ }
198
+
199
+ .language-markdown .token.blockquote.punctuation,
200
+ .language-markdown .token.hr.punctuation {
201
+ color: hsl(230, 4%, 64%);
202
+ font-style: italic;
203
+ }
204
+
205
+ .language-markdown .token.code-snippet {
206
+ color: hsl(119, 34%, 47%);
207
+ }
208
+
209
+ .language-markdown .token.bold .token.content {
210
+ color: hsl(35, 99%, 36%);
211
+ }
212
+
213
+ .language-markdown .token.italic .token.content {
214
+ color: hsl(301, 63%, 40%);
215
+ }
216
+
217
+ .language-markdown .token.strike .token.content,
218
+ .language-markdown .token.strike .token.punctuation,
219
+ .language-markdown .token.list.punctuation,
220
+ .language-markdown .token.title.important > .token.punctuation {
221
+ color: hsl(5, 74%, 59%);
222
+ }
223
+
224
+ /* General */
225
+ .token.bold {
226
+ font-weight: bold;
227
+ }
228
+
229
+ .token.comment,
230
+ .token.italic {
231
+ font-style: italic;
232
+ }
233
+
234
+ .token.entity {
235
+ cursor: help;
236
+ }
237
+
238
+ .token.namespace {
239
+ opacity: 0.8;
240
+ }
241
+
242
+ /* Plugin overrides */
243
+ /* Selectors should have higher specificity than those in the plugins' default stylesheets */
244
+
245
+ /* Show Invisibles plugin overrides */
246
+ .token.token.tab:not(:empty):before,
247
+ .token.token.cr:before,
248
+ .token.token.lf:before,
249
+ .token.token.space:before {
250
+ color: hsla(230, 8%, 24%, 0.2);
251
+ }
252
+
253
+ /* Toolbar plugin overrides */
254
+ /* Space out all buttons and move them away from the right edge of the code block */
255
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item {
256
+ margin-right: 0.4em;
257
+ }
258
+
259
+ /* Styling the buttons */
260
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > button,
261
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > a,
262
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > span {
263
+ background: hsl(230, 1%, 90%);
264
+ color: hsl(230, 6%, 44%);
265
+ padding: 0.1em 0.4em;
266
+ border-radius: 0.3em;
267
+ }
268
+
269
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover,
270
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus,
271
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover,
272
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus,
273
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover,
274
+ div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus {
275
+ background: hsl(230, 1%, 78%); /* custom: darken(--syntax-bg, 20%) */
276
+ color: hsl(230, 8%, 24%);
277
+ }
278
+
279
+ /* Line Highlight plugin overrides */
280
+ /* The highlighted line itself */
281
+ .line-highlight.line-highlight {
282
+ background: hsla(230, 8%, 24%, 0.05);
283
+ }
284
+
285
+ /* Default line numbers in Line Highlight plugin */
286
+ .line-highlight.line-highlight:before,
287
+ .line-highlight.line-highlight[data-end]:after {
288
+ background: hsl(230, 1%, 90%);
289
+ color: hsl(230, 8%, 24%);
290
+ padding: 0.1em 0.6em;
291
+ border-radius: 0.3em;
292
+ box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */
293
+ }
294
+
295
+ /* Hovering over a linkable line number (in the gutter area) */
296
+ /* Requires Line Numbers plugin as well */
297
+ pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before {
298
+ background-color: hsla(230, 8%, 24%, 0.05);
299
+ }
300
+
301
+ /* Line Numbers and Command Line plugins overrides */
302
+ /* Line separating gutter from coding area */
303
+ .line-numbers.line-numbers .line-numbers-rows,
304
+ .command-line .command-line-prompt {
305
+ border-right-color: hsla(230, 8%, 24%, 0.2);
306
+ }
307
+
308
+ /* Stuff in the gutter */
309
+ .line-numbers .line-numbers-rows > span:before,
310
+ .command-line .command-line-prompt > span:before {
311
+ color: hsl(230, 1%, 62%);
312
+ }
313
+
314
+ /* Match Braces plugin overrides */
315
+ /* Note: Outline colour is inherited from the braces */
316
+ .rainbow-braces .token.token.punctuation.brace-level-1,
317
+ .rainbow-braces .token.token.punctuation.brace-level-5,
318
+ .rainbow-braces .token.token.punctuation.brace-level-9 {
319
+ color: hsl(5, 74%, 59%);
320
+ }
321
+
322
+ .rainbow-braces .token.token.punctuation.brace-level-2,
323
+ .rainbow-braces .token.token.punctuation.brace-level-6,
324
+ .rainbow-braces .token.token.punctuation.brace-level-10 {
325
+ color: hsl(119, 34%, 47%);
326
+ }
327
+
328
+ .rainbow-braces .token.token.punctuation.brace-level-3,
329
+ .rainbow-braces .token.token.punctuation.brace-level-7,
330
+ .rainbow-braces .token.token.punctuation.brace-level-11 {
331
+ color: hsl(221, 87%, 60%);
332
+ }
333
+
334
+ .rainbow-braces .token.token.punctuation.brace-level-4,
335
+ .rainbow-braces .token.token.punctuation.brace-level-8,
336
+ .rainbow-braces .token.token.punctuation.brace-level-12 {
337
+ color: hsl(301, 63%, 40%);
338
+ }
339
+
340
+ /* Diff Highlight plugin overrides */
341
+ /* Taken from https://github.com/atom/github/blob/master/styles/variables.less */
342
+ pre.diff-highlight > code .token.token.deleted:not(.prefix),
343
+ pre > code.diff-highlight .token.token.deleted:not(.prefix) {
344
+ background-color: hsla(353, 100%, 66%, 0.15);
345
+ }
346
+
347
+ pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection,
348
+ pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection,
349
+ pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection,
350
+ pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection {
351
+ background-color: hsla(353, 95%, 66%, 0.25);
352
+ }
353
+
354
+ pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection,
355
+ pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection,
356
+ pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection,
357
+ pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection {
358
+ background-color: hsla(353, 95%, 66%, 0.25);
359
+ }
360
+
361
+ pre.diff-highlight > code .token.token.inserted:not(.prefix),
362
+ pre > code.diff-highlight .token.token.inserted:not(.prefix) {
363
+ background-color: hsla(137, 100%, 55%, 0.15);
364
+ }
365
+
366
+ pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection,
367
+ pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection,
368
+ pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection,
369
+ pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection {
370
+ background-color: hsla(135, 73%, 55%, 0.25);
371
+ }
372
+
373
+ pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection,
374
+ pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection,
375
+ pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection,
376
+ pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection {
377
+ background-color: hsla(135, 73%, 55%, 0.25);
378
+ }
379
+
380
+ /* Previewers plugin overrides */
381
+ /* Based on https://github.com/atom-community/atom-ide-datatip/blob/master/styles/atom-ide-datatips.less and https://github.com/atom/atom/blob/master/packages/one-light-ui */
382
+ /* Border around popup */
383
+ .prism-previewer.prism-previewer:before,
384
+ .prism-previewer-gradient.prism-previewer-gradient div {
385
+ border-color: hsl(0, 0, 95%);
386
+ }
387
+
388
+ /* Angle and time should remain as circles and are hence not included */
389
+ .prism-previewer-color.prism-previewer-color:before,
390
+ .prism-previewer-gradient.prism-previewer-gradient div,
391
+ .prism-previewer-easing.prism-previewer-easing:before {
392
+ border-radius: 0.3em;
393
+ }
394
+
395
+ /* Triangles pointing to the code */
396
+ .prism-previewer.prism-previewer:after {
397
+ border-top-color: hsl(0, 0, 95%);
398
+ }
399
+
400
+ .prism-previewer-flipped.prism-previewer-flipped.after {
401
+ border-bottom-color: hsl(0, 0, 95%);
402
+ }
403
+
404
+ /* Background colour within the popup */
405
+ .prism-previewer-angle.prism-previewer-angle:before,
406
+ .prism-previewer-time.prism-previewer-time:before,
407
+ .prism-previewer-easing.prism-previewer-easing {
408
+ background: hsl(0, 0%, 100%);
409
+ }
410
+
411
+ /* For angle, this is the positive area (eg. 90deg will display one quadrant in this colour) */
412
+ /* For time, this is the alternate colour */
413
+ .prism-previewer-angle.prism-previewer-angle circle,
414
+ .prism-previewer-time.prism-previewer-time circle {
415
+ stroke: hsl(230, 8%, 24%);
416
+ stroke-opacity: 1;
417
+ }
418
+
419
+ /* Stroke colours of the handle, direction point, and vector itself */
420
+ .prism-previewer-easing.prism-previewer-easing circle,
421
+ .prism-previewer-easing.prism-previewer-easing path,
422
+ .prism-previewer-easing.prism-previewer-easing line {
423
+ stroke: hsl(230, 8%, 24%);
424
+ }
425
+
426
+ /* Fill colour of the handle */
427
+ .prism-previewer-easing.prism-previewer-easing circle {
428
+ fill: transparent;
429
+ }
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <div class="mykit-preview">
3
+ <section>
4
+ <slot></slot>
5
+ </section>
6
+
7
+ <div v-show="codeVisible" class="source-code">
8
+ <pre class="language-html"><code class="language-html">{{ previewSourceCode }}</code></pre>
9
+ </div>
10
+
11
+ <div class="preview-bottom">
12
+ <span name="Code" @click="showSourceCode">查看代码</span>
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import Prism from 'prismjs';
19
+ import '../assets/prism.css';
20
+
21
+ const isDev = import.meta.env.MODE === 'development';
22
+
23
+ export default {
24
+ props: {
25
+ /** 组件名称 */
26
+ compName: {
27
+ type: String,
28
+ default: '',
29
+ require: true,
30
+ },
31
+ /** 要显示代码的组件 */
32
+ demoName: {
33
+ type: String,
34
+ default: '',
35
+ require: true,
36
+ },
37
+ },
38
+ data() {
39
+ return {
40
+ sourceCode: '',
41
+ codeVisible: false,
42
+ };
43
+ },
44
+ computed: {
45
+ previewSourceCode() {
46
+ return this.sourceCode.replace(/'\.\.\/\.\.\/index'/g, `'@tencent/my-kit'`);
47
+ },
48
+ },
49
+ async mounted() {
50
+ if (this.compName && this.demoName) {
51
+ if (isDev) {
52
+ this.sourceCode = (
53
+ await import(/* @vite-ignore */ `../../packages/${this.compName}/docs/${this.demoName}.vue?raw`)
54
+ ).default;
55
+ } else {
56
+ this.sourceCode = await fetch(`${isDev ? '' : '/MY-Kit'}/packages/${this.compName}/docs/${this.demoName}.vue`).then((res) => res.text());
57
+ }
58
+ }
59
+ await this.$nextTick();
60
+ Prism.highlightAll();
61
+ },
62
+ methods: {
63
+ async copyCode() {
64
+ // this.$copyText(this.sourceCode);
65
+ },
66
+ showSourceCode() {
67
+ this.codeVisible = !this.codeVisible;
68
+ },
69
+ },
70
+ };
71
+ </script>
72
+
73
+ <style lang="less">
74
+ pre {
75
+ line-height: 0;
76
+ }
77
+ .mykit-preview {
78
+ border: 4px;
79
+ border: 1px dashed #e7e7e7;
80
+ padding: 10px;
81
+ border-bottom: 1px dashed #e7e7e7;
82
+ section {
83
+ margin: 15px;
84
+ }
85
+ }
86
+
87
+ .source-code {
88
+ max-height: 500px;
89
+ }
90
+ .language-html {
91
+ margin: 0;
92
+ padding: 0 15px;
93
+ }
94
+ .preview-bottom {
95
+ height: 40px;
96
+ display: flex;
97
+ justify-content: center;
98
+ align-items: center;
99
+ border-top: 1px dashed #e7e7e7;
100
+ }
101
+ </style>
package/src/env.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ declare module '*.vue' {
2
+ import { DefineComponent } from 'vue';
3
+ const component: DefineComponent<{}, {}, any>;
4
+ export default component;
5
+ }
6
+
7
+ declare module '*.md' {
8
+ import { ComponentOptions } from 'vue';
9
+ const Component: ComponentOptions;
10
+ export default Component;
11
+ }
package/src/main.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+ import router from './router'
4
+
5
+ import './assets/markdown.css';
6
+
7
+ import MyKit from '../packages';
8
+ import Preview from './components/Preview.vue';
9
+
10
+ const app = createApp(App)
11
+ app.component('Preview', Preview)
12
+ app.use(MyKit).use(router).mount('#app')
package/src/router.ts ADDED
@@ -0,0 +1,35 @@
1
+ /* eslint-disable prettier/prettier */
2
+
3
+ /**
4
+ * !--------- FBI WARNING ----------!
5
+ *
6
+ * 根据 /packages 目录下的组件所生成的组件类侧边导航栏配置,请勿手动修改
7
+ */
8
+
9
+ import { createRouter, createWebHashHistory, RouterOptions } from 'vue-router'
10
+
11
+ const routes = [{
12
+ title: '按钮',
13
+ name: 'Button',
14
+ path: '/components/Button',
15
+ component: () => import('packages/Button/docs/README.md'),
16
+ },{
17
+ title: '测试组件',
18
+ name: 'Foo',
19
+ path: '/components/Foo',
20
+ component: () => import('packages/Foo/docs/README.md'),
21
+ }];
22
+
23
+ const routerConfig = {
24
+ history: createWebHashHistory(),
25
+ routes,
26
+ scrollBehavior(to: any, from: any) {
27
+ if (to.path !== from.path) {
28
+ return { top: 0 };
29
+ }
30
+ },
31
+ };
32
+
33
+ const router = createRouter(routerConfig as RouterOptions);
34
+
35
+ export default router;
package/tsconfig.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "useDefineForClassFields": true,
5
+ "module": "esnext",
6
+ "moduleResolution": "node",
7
+ "strict": true,
8
+ "jsx": "preserve",
9
+ "sourceMap": true,
10
+ "resolveJsonModule": true,
11
+ "esModuleInterop": true,
12
+ "allowJs": true,
13
+ "lib": ["esnext", "dom"],
14
+ "skipLibCheck": true,
15
+ "paths": {
16
+ "packages/*": ["./packages/*"]
17
+ }
18
+ },
19
+ "include": [
20
+ "*.ts",
21
+ "src/**/*.ts",
22
+ "src/**/*.d.ts",
23
+ "src/**/*.tsx",
24
+ "src/**/*.vue",
25
+ "packages/**/*.ts",
26
+ "packages/**/*.d.ts",
27
+ "packages/**/*.tsx",
28
+ "packages/**/*.vue"
29
+ ]
30
+ }