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.
- package/.idea/dionysus.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/build/base.config.ts +20 -0
- package/build/doc.config.ts +10 -0
- package/build/lib.config.ts +31 -0
- package/dist/index.css +1 -0
- package/dist/my-kit.es.js +254 -0
- package/dist/my-kit.umd.js +2 -0
- package/dist/packages/Button/index.d.ts +4 -0
- package/dist/packages/Button/src/index.vue.d.ts +4 -0
- package/dist/packages/Foo/index.d.ts +4 -0
- package/dist/packages/TabPage/index.d.ts +4 -0
- package/dist/packages/TabPage/src/index.vue.d.ts +70 -0
- package/dist/packages/index.d.ts +11 -0
- package/dist/src/env.d.ts +11 -0
- package/docs/assets/README.04f9b87a.js +1 -0
- package/docs/assets/README.e027c703.js +1 -0
- package/docs/assets/index.55b9c1a5.js +1 -0
- package/docs/assets/index.f005ac77.css +1 -0
- package/docs/assets/vendor.234e3e3c.js +12 -0
- package/docs/index.html +16 -0
- package/docs/packages/Button/docs/README.md +9 -0
- package/docs/packages/Button/docs/demo.vue +11 -0
- package/docs/packages/Button/index.ts +10 -0
- package/docs/packages/Button/src/index.vue +26 -0
- package/docs/packages/Foo/docs/README.md +28 -0
- package/docs/packages/Foo/docs/demo.vue +5 -0
- package/docs/packages/Foo/index.ts +12 -0
- package/docs/packages/Foo/src/index.vue +15 -0
- package/docs/packages/index.ts +23 -0
- package/docs/packages/list.json +14 -0
- package/index.html +13 -0
- package/package.json +30 -0
- package/packages/Button/docs/README.md +9 -0
- package/packages/Button/docs/demo.vue +11 -0
- package/packages/Button/index.ts +10 -0
- package/packages/Button/src/index.vue +26 -0
- package/packages/Foo/docs/README.md +28 -0
- package/packages/Foo/docs/demo.vue +5 -0
- package/packages/Foo/index.ts +12 -0
- package/packages/Foo/src/index.vue +15 -0
- package/packages/TabPage/index.ts +10 -0
- package/packages/TabPage/src/index.vue +499 -0
- package/packages/index.ts +26 -0
- package/packages/list.json +20 -0
- package/script/copyDir.js +7 -0
- package/script/genNewComp/.template/docs/README.md.tpl +28 -0
- package/script/genNewComp/.template/docs/demo.vue.tpl +5 -0
- package/script/genNewComp/.template/index.ts.tpl +12 -0
- package/script/genNewComp/.template/install.ts.tpl +20 -0
- package/script/genNewComp/.template/router.ts.tpl +25 -0
- package/script/genNewComp/.template/src/index.vue.tpl +15 -0
- package/script/genNewComp/index.js +9 -0
- package/script/genNewComp/infoCollector.js +63 -0
- package/script/genNewComp/tplReplacer.js +95 -0
- package/src/App.vue +46 -0
- package/src/assets/markdown.css +273 -0
- package/src/assets/prism.css +429 -0
- package/src/components/Preview.vue +101 -0
- package/src/env.d.ts +11 -0
- package/src/main.ts +12 -0
- package/src/router.ts +35 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="g-box">
|
|
3
|
+
<button
|
|
4
|
+
class="u-page-btn s-previous-btn"
|
|
5
|
+
v-if="isHorizontal"
|
|
6
|
+
@click="previous"
|
|
7
|
+
>
|
|
8
|
+
<svg
|
|
9
|
+
t="1704703004061"
|
|
10
|
+
class="icon"
|
|
11
|
+
viewBox="0 0 1024 1024"
|
|
12
|
+
version="1.1"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
p-id="4356"
|
|
15
|
+
width="16"
|
|
16
|
+
height="16"
|
|
17
|
+
>
|
|
18
|
+
<path
|
|
19
|
+
d="M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z"
|
|
20
|
+
fill="#272636"
|
|
21
|
+
p-id="4357"
|
|
22
|
+
></path>
|
|
23
|
+
</svg>
|
|
24
|
+
</button>
|
|
25
|
+
<div class="g-dionysus-box">
|
|
26
|
+
<ul
|
|
27
|
+
class="g-tab-page-box"
|
|
28
|
+
:style="ulStyle"
|
|
29
|
+
@mouseleave="hoverKey = -1"
|
|
30
|
+
>
|
|
31
|
+
<li
|
|
32
|
+
class="u-li"
|
|
33
|
+
v-for="item in props.modelValue"
|
|
34
|
+
:key="item.key"
|
|
35
|
+
:data-active="props.activeKey === item.key"
|
|
36
|
+
:data-active-before="activeBeforeKey === item.key"
|
|
37
|
+
:data-active-after="activeAfterKey === item.key"
|
|
38
|
+
@mouseenter="hoverKey = item.key"
|
|
39
|
+
:data-hover="hoverKey === item.key"
|
|
40
|
+
:data-hover-before="hoverBeforeKey === item.key"
|
|
41
|
+
:data-hover-after="hoverAfterKey === item.key"
|
|
42
|
+
@click="openPage(item.key)"
|
|
43
|
+
>
|
|
44
|
+
<div class="u-gp">
|
|
45
|
+
<!--<el-icon class="u-icon">-->
|
|
46
|
+
<!-- <component :is="item.icon"></component>-->
|
|
47
|
+
<!--</el-icon>-->
|
|
48
|
+
<!--<div v-html="item.icon"></div>-->
|
|
49
|
+
<!--<component :is="item.icon"></component>-->
|
|
50
|
+
<span class="u-sn">{{ item.title }}</span>
|
|
51
|
+
<div
|
|
52
|
+
class="u-btn"
|
|
53
|
+
@click.stop="close([item.key])"
|
|
54
|
+
>
|
|
55
|
+
<i class="s-icon"></i>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</li>
|
|
59
|
+
</ul>
|
|
60
|
+
</div>
|
|
61
|
+
<button
|
|
62
|
+
class="u-page-btn s-next-btn"
|
|
63
|
+
v-if="isHorizontal"
|
|
64
|
+
@click="next"
|
|
65
|
+
>
|
|
66
|
+
<svg
|
|
67
|
+
t="1704703004061"
|
|
68
|
+
class="icon"
|
|
69
|
+
viewBox="0 0 1024 1024"
|
|
70
|
+
version="1.1"
|
|
71
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
72
|
+
p-id="4356"
|
|
73
|
+
width="16"
|
|
74
|
+
height="16"
|
|
75
|
+
>
|
|
76
|
+
<path
|
|
77
|
+
d="M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z"
|
|
78
|
+
fill="#272636"
|
|
79
|
+
p-id="4357"
|
|
80
|
+
></path>
|
|
81
|
+
</svg>
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import { ref, computed, watch, onMounted } from 'vue'
|
|
88
|
+
|
|
89
|
+
const isContentOverflowing = (element: Element) => {
|
|
90
|
+
return {
|
|
91
|
+
horizontal: element.scrollWidth > element.clientWidth,
|
|
92
|
+
vertical: element.scrollHeight > element.clientHeight
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface MenuItem {
|
|
97
|
+
title: string,
|
|
98
|
+
key: string
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// interface TabPage {
|
|
102
|
+
// key: string,
|
|
103
|
+
// title: string
|
|
104
|
+
// }
|
|
105
|
+
|
|
106
|
+
const props = withDefaults(defineProps<{
|
|
107
|
+
modelValue?: MenuItem[], // 菜单数组
|
|
108
|
+
activeKey?: string, // 当前激活key
|
|
109
|
+
showRightClickMenu?: boolean // 是否显示右键菜单
|
|
110
|
+
}>(), {
|
|
111
|
+
modelValue: () => [],
|
|
112
|
+
activeKey: '',
|
|
113
|
+
showRightClickMenu: false
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
const activeKey = ref(props.activeKey)
|
|
117
|
+
watch(
|
|
118
|
+
() => props.activeKey,
|
|
119
|
+
(newVal: string) => {
|
|
120
|
+
activeKey.value = newVal
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
const emit = defineEmits(['close', 'click'])
|
|
125
|
+
|
|
126
|
+
const list = computed(() => {
|
|
127
|
+
return props.modelValue.map((item: MenuItem) => {
|
|
128
|
+
return {
|
|
129
|
+
key: item.key,
|
|
130
|
+
title: item.title
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
const isHorizontal = ref(false)
|
|
136
|
+
const horizontalMaxSize = ref(0)
|
|
137
|
+
const horizontalSize = ref(0)
|
|
138
|
+
|
|
139
|
+
const ulStyle = computed(() => {
|
|
140
|
+
const size = horizontalSize.value > horizontalMaxSize.value ? horizontalMaxSize.value : horizontalSize.value
|
|
141
|
+
return {
|
|
142
|
+
transform: 'translateX(-' + (isHorizontal.value ? size : 0) + 'px)'
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
const previous = () => {
|
|
147
|
+
horizontalSize.value -= 300
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const next = () => {
|
|
151
|
+
horizontalSize.value += 300
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const checkHorizontal = () => {
|
|
155
|
+
const el = document.querySelector('.g-tab-page-box')
|
|
156
|
+
if (!el) return false
|
|
157
|
+
const { horizontal } = isContentOverflowing(el)
|
|
158
|
+
isHorizontal.value = horizontal
|
|
159
|
+
if (horizontal) horizontalMaxSize.value = el.scrollWidth - el.clientWidth
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
watch(
|
|
163
|
+
() => list.value,
|
|
164
|
+
() => {
|
|
165
|
+
setTimeout(() => {
|
|
166
|
+
checkHorizontal()
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
onMounted(() => {
|
|
171
|
+
checkHorizontal()
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
175
|
+
checkHorizontal()
|
|
176
|
+
})
|
|
177
|
+
onMounted(() => {
|
|
178
|
+
const el: Element | null = document.querySelector('.g-tab-page-box')
|
|
179
|
+
if (!el) return false
|
|
180
|
+
resizeObserver.observe(el)
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
const activeBeforeKey = computed(() => {
|
|
184
|
+
const index = list.value.findIndex(item => item.key === props.activeKey)
|
|
185
|
+
if (index === -1) return -1
|
|
186
|
+
return list.value[index - 1]?.key
|
|
187
|
+
})
|
|
188
|
+
const activeAfterKey = computed(() => {
|
|
189
|
+
const index = list.value.findIndex(item => item.key === props.activeKey)
|
|
190
|
+
if (index === -1) return -1
|
|
191
|
+
return list.value[index + 1]?.key
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
const hoverKey: any = ref(2)
|
|
195
|
+
const hoverBeforeKey = computed(() => {
|
|
196
|
+
const index = list.value.findIndex(item => item.key === hoverKey.value)
|
|
197
|
+
if (index === -1) return -1
|
|
198
|
+
return list.value[index - 1]?.key
|
|
199
|
+
})
|
|
200
|
+
const hoverAfterKey = computed(() => {
|
|
201
|
+
const index = list.value.findIndex(item => item.key === hoverKey.value)
|
|
202
|
+
if (index === -1) return -1
|
|
203
|
+
return list.value[index + 1]?.key
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
// const contextMenuConfig = [{
|
|
207
|
+
// title: '关闭当前',
|
|
208
|
+
// callback () {
|
|
209
|
+
// close([props.activeKey])
|
|
210
|
+
// }
|
|
211
|
+
// }, {
|
|
212
|
+
// title: '关闭其他',
|
|
213
|
+
// callback () {
|
|
214
|
+
// const keys = list.value.filter((item: TabPage) => item.key !== props.activeKey).map((item: TabPage) => item.key)
|
|
215
|
+
// close(keys)
|
|
216
|
+
// }
|
|
217
|
+
// }, {
|
|
218
|
+
// title: '关闭右侧',
|
|
219
|
+
// callback () {
|
|
220
|
+
// const keys = list.value.slice(list.value.findIndex(item => item.key === props.activeKey) + 1).map(item => item.key)
|
|
221
|
+
// close(keys)
|
|
222
|
+
// }
|
|
223
|
+
// }, {
|
|
224
|
+
// title: '关闭左侧',
|
|
225
|
+
// callback () {
|
|
226
|
+
// const keys = list.value.slice(0, list.value.findIndex(item => item.key === props.activeKey)).map(item => item.key)
|
|
227
|
+
// close(keys)
|
|
228
|
+
// }
|
|
229
|
+
// }]
|
|
230
|
+
// console.log('contextMenuConfig', contextMenuConfig)
|
|
231
|
+
|
|
232
|
+
// 打开标签页
|
|
233
|
+
const openPage = (key: string) => {
|
|
234
|
+
emit('click', key)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// 关闭标签页
|
|
238
|
+
const close = (keys: string[] = []) => {
|
|
239
|
+
emit('close', keys)
|
|
240
|
+
}
|
|
241
|
+
</script>
|
|
242
|
+
|
|
243
|
+
<style scoped>
|
|
244
|
+
.g-box {
|
|
245
|
+
position: relative;
|
|
246
|
+
overflow: hidden;
|
|
247
|
+
padding-left: 16px;
|
|
248
|
+
padding-right: 16px;
|
|
249
|
+
width: 100%;
|
|
250
|
+
background-color: #fff;
|
|
251
|
+
box-sizing: border-box;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.g-box .u-page-btn {
|
|
255
|
+
position: absolute;
|
|
256
|
+
bottom: 0;
|
|
257
|
+
height: 33px;
|
|
258
|
+
border: 0;
|
|
259
|
+
box-sizing: border-box;
|
|
260
|
+
background-color: #fff;
|
|
261
|
+
opacity: 0.6;
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.g-box .s-previous-btn {
|
|
266
|
+
left: 0;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.g-box .s-next-btn {
|
|
270
|
+
right: 0;
|
|
271
|
+
transform: rotate(180deg);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.g-dionysus-box {
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
width: 100%;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.g-tab-page-box {
|
|
280
|
+
display: flex;
|
|
281
|
+
color: #4a4a4a;
|
|
282
|
+
white-space: nowrap;
|
|
283
|
+
box-sizing: border-box;
|
|
284
|
+
box-shadow: 2px 0 8px #1d23290d;
|
|
285
|
+
transform: translateX(0);
|
|
286
|
+
transition: .2s;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.g-tab-page-box .u-li {
|
|
290
|
+
display: inline-block;
|
|
291
|
+
position: relative;
|
|
292
|
+
height: 33px;
|
|
293
|
+
font-size: 14px;
|
|
294
|
+
box-sizing: border-box;
|
|
295
|
+
cursor: pointer;
|
|
296
|
+
/*hover*/
|
|
297
|
+
/*激活*/
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.g-tab-page-box .u-li .u-gp {
|
|
301
|
+
display: flex;
|
|
302
|
+
position: relative;
|
|
303
|
+
z-index: 1;
|
|
304
|
+
padding: 6px 8px;
|
|
305
|
+
height: 100%;
|
|
306
|
+
align-items: center;
|
|
307
|
+
background-color: #fff;
|
|
308
|
+
border-radius: 6px 6px 0 0;
|
|
309
|
+
box-sizing: border-box;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.g-tab-page-box .u-li .u-gp:after {
|
|
313
|
+
position: absolute;
|
|
314
|
+
bottom: 0;
|
|
315
|
+
right: 0;
|
|
316
|
+
z-index: 1;
|
|
317
|
+
content: '';
|
|
318
|
+
width: 12px;
|
|
319
|
+
height: 12px;
|
|
320
|
+
border-radius: 6px 6px 0 6px;
|
|
321
|
+
pointer-events: none;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.g-tab-page-box .u-li .u-gp:before {
|
|
325
|
+
position: absolute;
|
|
326
|
+
bottom: 0;
|
|
327
|
+
left: 0;
|
|
328
|
+
z-index: 1;
|
|
329
|
+
content: '';
|
|
330
|
+
width: 12px;
|
|
331
|
+
height: 12px;
|
|
332
|
+
border-radius: 6px 6px 6px 0;
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.g-tab-page-box .u-li:after {
|
|
337
|
+
position: absolute;
|
|
338
|
+
bottom: 0;
|
|
339
|
+
right: 0;
|
|
340
|
+
z-index: 2;
|
|
341
|
+
content: '';
|
|
342
|
+
width: 12px;
|
|
343
|
+
height: 12px;
|
|
344
|
+
border-radius: 6px;
|
|
345
|
+
pointer-events: none;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.g-tab-page-box .u-li:before {
|
|
349
|
+
position: absolute;
|
|
350
|
+
bottom: 0;
|
|
351
|
+
left: 0;
|
|
352
|
+
z-index: 2;
|
|
353
|
+
content: '';
|
|
354
|
+
width: 12px;
|
|
355
|
+
height: 12px;
|
|
356
|
+
border-radius: 6px;
|
|
357
|
+
pointer-events: none;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.g-tab-page-box .u-li[data-hover="true"] .u-gp, .g-tab-page-box .u-li[data-hover="true"] .u-gp:after, .g-tab-page-box .u-li[data-hover="true"] .u-gp:before, .g-tab-page-box .u-li[data-hover="true"][data-active="false"]:after, .g-tab-page-box .u-li[data-hover="true"][data-active="false"]:before {
|
|
361
|
+
background-color: #dfe1e5;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.g-tab-page-box .u-li[data-hover-before="true"] .u-gp:after {
|
|
365
|
+
background-color: #dfe1e5;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.g-tab-page-box .u-li[data-hover-before="true"]:after {
|
|
369
|
+
background-color: #fff;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.g-tab-page-box .u-li[data-hover-after="true"] .u-gp:before {
|
|
373
|
+
background-color: #dfe1e5;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.g-tab-page-box .u-li[data-hover-after="true"]:before {
|
|
377
|
+
background-color: #fff;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.g-tab-page-box .u-li[data-active-before="true"] .u-gp:after {
|
|
381
|
+
background-color: #f0f0ff;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.g-tab-page-box .u-li[data-active-before="true"]:after {
|
|
385
|
+
background-color: #fff;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.g-tab-page-box .u-li[data-active-after="true"] .u-gp:before {
|
|
389
|
+
background-color: #f0f0ff;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.g-tab-page-box .u-li[data-active-after="true"]:before {
|
|
393
|
+
background-color: #fff;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.g-tab-page-box .u-li[data-active="true"] {
|
|
397
|
+
color: #646CFFFF;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.g-tab-page-box .u-li[data-active="true"] .u-gp, .g-tab-page-box .u-li[data-active="true"] .u-gp:before, .g-tab-page-box .u-li[data-active="true"] .u-gp:after, .g-tab-page-box .u-li[data-active="true"]:after, .g-tab-page-box .u-li[data-active="true"]:before {
|
|
401
|
+
background-color: #f0f0ff;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.g-tab-page-box .u-li .u-icon {
|
|
405
|
+
margin-right: 14px;
|
|
406
|
+
pointer-events: none;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.g-tab-page-box .u-li .u-sn {
|
|
410
|
+
pointer-events: none;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.g-tab-page-box .u-li .u-btn {
|
|
414
|
+
position: relative;
|
|
415
|
+
margin-left: 14px;
|
|
416
|
+
width: 14px;
|
|
417
|
+
height: 14px;
|
|
418
|
+
font-size: 14px;
|
|
419
|
+
border-radius: 50%;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.g-tab-page-box .u-li .u-btn:after {
|
|
423
|
+
position: absolute;
|
|
424
|
+
top: 0;
|
|
425
|
+
left: 0;
|
|
426
|
+
z-index: 1;
|
|
427
|
+
width: 100%;
|
|
428
|
+
height: 100%;
|
|
429
|
+
content: '';
|
|
430
|
+
border-radius: 50%;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.g-tab-page-box .u-li .u-btn:hover {
|
|
434
|
+
color: #fff;
|
|
435
|
+
background-color: #9ca3af;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.g-tab-page-box .u-li[data-active="true"] .u-btn:hover {
|
|
439
|
+
color: #fff;
|
|
440
|
+
background-color: #646CFFFF;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.g-tab-page-box .s-icon {
|
|
444
|
+
display: block;
|
|
445
|
+
position: relative;
|
|
446
|
+
width: 14px;
|
|
447
|
+
height: 14px;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.g-tab-page-box .s-icon:after {
|
|
451
|
+
position: absolute;
|
|
452
|
+
top: 50%;
|
|
453
|
+
left: 50%;
|
|
454
|
+
content: '';
|
|
455
|
+
width: 1px;
|
|
456
|
+
height: 10px;
|
|
457
|
+
background-color: rgba(48, 49, 51);
|
|
458
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.g-tab-page-box .s-icon:before {
|
|
462
|
+
position: absolute;
|
|
463
|
+
top: 50%;
|
|
464
|
+
left: 50%;
|
|
465
|
+
content: '';
|
|
466
|
+
width: 1px;
|
|
467
|
+
height: 10px;
|
|
468
|
+
background-color: rgba(48, 49, 51);
|
|
469
|
+
transform: translate(-50%, -50%) rotate(-45deg);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.g-tab-page-box .u-li[data-active="true"] .s-icon:after, .g-tab-page-box .u-li[data-active="true"] .s-icon:before {
|
|
473
|
+
background-color: rgb(100, 108, 255)
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.g-tab-page-box .u-li .u-btn:hover .s-icon:after, .g-tab-page-box .u-li .u-btn:hover .s-icon:before {
|
|
477
|
+
background-color: #fff;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.g-tab-page-box .u-li[data-active="true"] .u-btn:hover .s-icon:after, .g-tab-page-box .u-li[data-active="true"] .u-btn:hover .s-icon:before {
|
|
481
|
+
background-color: #fff;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.g-tab-page-box .u-li[data-active="false"][data-hover="false"][data-active-before="false"][data-hover-before="false"] .u-sn:after {
|
|
485
|
+
position: absolute;
|
|
486
|
+
top: 50%;
|
|
487
|
+
right: 0;
|
|
488
|
+
z-index: 2;
|
|
489
|
+
content: '';
|
|
490
|
+
width: 1px;
|
|
491
|
+
height: 50%;
|
|
492
|
+
transform: translateY(-50%);
|
|
493
|
+
background-color: #4a4a4a;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.g-tab-page-box .u-li:nth-last-of-type(1)[data-active="false"][data-hover="false"] .u-sn:after {
|
|
497
|
+
background-color: rgba(0, 0, 0, 0) !important;
|
|
498
|
+
}
|
|
499
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* !--------- FBI WARNING ----------!
|
|
5
|
+
*
|
|
6
|
+
* 根据 /packages 目录下的组件所生成的模块导出,请勿手动修改
|
|
7
|
+
*/
|
|
8
|
+
import { App, Plugin } from 'vue';
|
|
9
|
+
|
|
10
|
+
import { ButtonPlugin } from './Button';
|
|
11
|
+
import { FooPlugin } from './Foo';
|
|
12
|
+
import { TabPagePlugin } from './TabPage';
|
|
13
|
+
|
|
14
|
+
const MYKitPlugin: Plugin = {
|
|
15
|
+
install(app: App) {
|
|
16
|
+
ButtonPlugin.install?.(app);
|
|
17
|
+
FooPlugin.install?.(app);
|
|
18
|
+
TabPagePlugin.install?.(app);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default MYKitPlugin;
|
|
23
|
+
|
|
24
|
+
export * from './Button'
|
|
25
|
+
export * from './Foo'
|
|
26
|
+
export * from './TabPage'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"compName": "Button",
|
|
4
|
+
"compZhName": "按钮",
|
|
5
|
+
"compDesc": "这是一个按钮",
|
|
6
|
+
"compClassName": "button"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"compName": "Foo",
|
|
10
|
+
"compZhName": "测试组件",
|
|
11
|
+
"compDesc": "默认:这是一个新组件",
|
|
12
|
+
"compClassName": "foo"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"compName": "TabPage",
|
|
16
|
+
"compZhName": "标签页组件",
|
|
17
|
+
"compDesc": "默认:这是一个新组件",
|
|
18
|
+
"compClassName": "tabPage"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- 加载 demo 组件 start -->
|
|
2
|
+
<script setup>
|
|
3
|
+
import demo from './demo.vue'
|
|
4
|
+
</script>
|
|
5
|
+
<!-- 加载 demo 组件 end -->
|
|
6
|
+
|
|
7
|
+
<!-- 正文开始 -->
|
|
8
|
+
|
|
9
|
+
# {{ compZhName }}
|
|
10
|
+
|
|
11
|
+
{{ compDesc }}
|
|
12
|
+
|
|
13
|
+
## 基础用法
|
|
14
|
+
<Preview comp-name="{{compName}}" demo-name="demo">
|
|
15
|
+
<demo />
|
|
16
|
+
</Preview>
|
|
17
|
+
|
|
18
|
+
## 属性
|
|
19
|
+
参数 | 说明 | 类型 | 可选值 | 默认值 | 是否必填
|
|
20
|
+
:-: | :-: | :-: | :-: | :-: | :-:
|
|
21
|
+
`arg1` | 第一个参数 | string | - | `default` | 否
|
|
22
|
+
`arg2` | 第二个参数 | string | - | `default` | 否
|
|
23
|
+
|
|
24
|
+
## 事件
|
|
25
|
+
事件名 | 说明 | 参数列表 | 参数说明
|
|
26
|
+
:-: | :-: | :-: | :-:
|
|
27
|
+
`click` | 点击事件 | $event | 原生的 dom event
|
|
28
|
+
`customEvent` | 自定义事件 | [a, b, c] | a:参数一;b:参数二;c:参数三
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App, Plugin } from 'vue';
|
|
2
|
+
import {{ compName }} from './src/index.vue';
|
|
3
|
+
|
|
4
|
+
export const {{ compName }}Plugin: Plugin = {
|
|
5
|
+
install(app: App) {
|
|
6
|
+
app.component('my-{{ compClassName }}', {{ compName }});
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
{{ compName }},
|
|
12
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* !--------- FBI WARNING ----------!
|
|
5
|
+
*
|
|
6
|
+
* 根据 /packages 目录下的组件所生成的模块导出,请勿手动修改
|
|
7
|
+
*/
|
|
8
|
+
import { App, Plugin } from 'vue';
|
|
9
|
+
|
|
10
|
+
{{ importPlugins }}
|
|
11
|
+
|
|
12
|
+
const MYKitPlugin: Plugin = {
|
|
13
|
+
install(app: App) {
|
|
14
|
+
{{ installPlugins }}
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default MYKitPlugin;
|
|
19
|
+
|
|
20
|
+
{{ exportPlugins }}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 = [{{ routes }}];
|
|
12
|
+
|
|
13
|
+
const routerConfig = {
|
|
14
|
+
history: createWebHashHistory(),
|
|
15
|
+
routes,
|
|
16
|
+
scrollBehavior(to: any, from: any) {
|
|
17
|
+
if (to.path !== from.path) {
|
|
18
|
+
return { top: 0 };
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const router = createRouter(routerConfig as RouterOptions);
|
|
24
|
+
|
|
25
|
+
export default router;
|