vue-stack-tabs 0.1.12 → 0.1.13
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/{types → dist}/src/lib/hooks/useStackTab.d.ts +2 -2
- package/{types → dist}/src/lib/hooks/useTabpanel.d.ts +6 -2
- package/{types → dist}/src/lib/index.d.ts +5 -0
- package/{types → dist}/src/lib/model/TabModel.d.ts +2 -1
- package/dist/style.css +1 -1
- package/dist/vue-stack-tabs.es.js +2340 -2322
- package/dist/vue-stack-tabs.umd.js +10 -10
- package/package.json +3 -4
- package/src/lib/StackTabs.vue +136 -126
- package/src/lib/assets/style/common/mixins.scss +45 -45
- package/src/lib/assets/style/common/var.scss +65 -65
- package/src/lib/assets/style/icon.scss +93 -93
- package/src/lib/assets/style/index.scss +4 -4
- package/src/lib/assets/style/overlayer.scss +40 -40
- package/src/lib/assets/style/stackTab.scss +395 -395
- package/src/lib/assets/style/transition.scss +40 -40
- package/src/lib/banner.ts +51 -51
- package/src/lib/components/ContextMenu/ContextMenuItem.vue +15 -15
- package/src/lib/components/ContextMenu/index.vue +129 -129
- package/src/lib/components/OverlayLoading/Component.vue +182 -191
- package/src/lib/components/OverlayLoading/api.ts +31 -31
- package/src/lib/components/OverlayLoading/helpers.ts +31 -31
- package/src/lib/components/OverlayLoading/index.ts +12 -12
- package/src/lib/components/OverlayLoading/loaders/bars.vue +79 -79
- package/src/lib/components/OverlayLoading/loaders/dots.vue +92 -92
- package/src/lib/components/OverlayLoading/loaders/index.ts +9 -9
- package/src/lib/components/OverlayLoading/loaders/spinner.vue +41 -41
- package/src/lib/components/TabHeader/TabHeaderButton.vue +35 -35
- package/src/lib/components/TabHeader/TabHeaderItem.vue +63 -63
- package/src/lib/components/TabHeader/TabHeaderScroll.vue +240 -240
- package/src/lib/components/TabHeader/index.vue +135 -135
- package/src/lib/hooks/useContextMenu.ts +50 -50
- package/src/lib/hooks/useStackTab.ts +74 -65
- package/src/lib/hooks/useTabLoading.ts +34 -34
- package/src/lib/hooks/useTabRouter.ts +94 -94
- package/src/lib/hooks/useTabpanel.tsx +516 -491
- package/src/lib/i18n/index.ts +72 -72
- package/src/lib/i18n/lang/en.ts +15 -15
- package/src/lib/i18n/lang/zh-CN.ts +15 -15
- package/src/lib/iframe.vue +7 -7
- package/src/lib/index.ts +32 -24
- package/src/lib/model/TabModel.ts +178 -169
- package/src/lib/utils/TabIdHelper.ts +70 -70
- package/src/lib/utils/TabScrollHelper.ts +104 -104
- package/src/lib/utils/UriHelper.ts +22 -22
- /package/{types → dist}/index.d.ts +0 -0
- /package/{types → dist}/src/lib/StackTabs.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/banner.d.ts +0 -0
- /package/{types → dist}/src/lib/components/ContextMenu/ContextMenuItem.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/ContextMenu/index.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/OverlayLoading/Component.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/OverlayLoading/api.d.ts +0 -0
- /package/{types → dist}/src/lib/components/OverlayLoading/helpers.d.ts +0 -0
- /package/{types → dist}/src/lib/components/OverlayLoading/index.d.ts +0 -0
- /package/{types → dist}/src/lib/components/OverlayLoading/loaders/bars.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/OverlayLoading/loaders/dots.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/OverlayLoading/loaders/index.d.ts +0 -0
- /package/{types → dist}/src/lib/components/OverlayLoading/loaders/spinner.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/TabHeader/TabHeaderButton.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/TabHeader/TabHeaderItem.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/TabHeader/TabHeaderScroll.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/components/TabHeader/index.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/hooks/useContextMenu.d.ts +0 -0
- /package/{types → dist}/src/lib/hooks/useTabLoading.d.ts +0 -0
- /package/{types → dist}/src/lib/hooks/useTabRouter.d.ts +0 -0
- /package/{types → dist}/src/lib/i18n/index.d.ts +0 -0
- /package/{types → dist}/src/lib/i18n/lang/en.d.ts +0 -0
- /package/{types → dist}/src/lib/i18n/lang/zh-CN.d.ts +0 -0
- /package/{types → dist}/src/lib/iframe.vue.d.ts +0 -0
- /package/{types → dist}/src/lib/utils/TabIdHelper.d.ts +0 -0
- /package/{types → dist}/src/lib/utils/TabScrollHelper.d.ts +0 -0
- /package/{types → dist}/src/lib/utils/UriHelper.d.ts +0 -0
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
-
viewBox="0 0 30 30"
|
|
5
|
-
:height="height"
|
|
6
|
-
:width="width"
|
|
7
|
-
:fill="color"
|
|
8
|
-
>
|
|
9
|
-
<rect x="0" y="13" width="4" height="5">
|
|
10
|
-
<animate
|
|
11
|
-
attributeName="height"
|
|
12
|
-
attributeType="XML"
|
|
13
|
-
values="5;21;5"
|
|
14
|
-
begin="0s"
|
|
15
|
-
dur="0.6s"
|
|
16
|
-
repeatCount="indefinite"
|
|
17
|
-
/>
|
|
18
|
-
<animate
|
|
19
|
-
attributeName="y"
|
|
20
|
-
attributeType="XML"
|
|
21
|
-
values="13; 5; 13"
|
|
22
|
-
begin="0s"
|
|
23
|
-
dur="0.6s"
|
|
24
|
-
repeatCount="indefinite"
|
|
25
|
-
/>
|
|
26
|
-
</rect>
|
|
27
|
-
<rect x="10" y="13" width="4" height="5">
|
|
28
|
-
<animate
|
|
29
|
-
attributeName="height"
|
|
30
|
-
attributeType="XML"
|
|
31
|
-
values="5;21;5"
|
|
32
|
-
begin="0.15s"
|
|
33
|
-
dur="0.6s"
|
|
34
|
-
repeatCount="indefinite"
|
|
35
|
-
/>
|
|
36
|
-
<animate
|
|
37
|
-
attributeName="y"
|
|
38
|
-
attributeType="XML"
|
|
39
|
-
values="13; 5; 13"
|
|
40
|
-
begin="0.15s"
|
|
41
|
-
dur="0.6s"
|
|
42
|
-
repeatCount="indefinite"
|
|
43
|
-
/>
|
|
44
|
-
</rect>
|
|
45
|
-
<rect x="20" y="13" width="4" height="5">
|
|
46
|
-
<animate
|
|
47
|
-
attributeName="height"
|
|
48
|
-
attributeType="XML"
|
|
49
|
-
values="5;21;5"
|
|
50
|
-
begin="0.3s"
|
|
51
|
-
dur="0.6s"
|
|
52
|
-
repeatCount="indefinite"
|
|
53
|
-
/>
|
|
54
|
-
<animate
|
|
55
|
-
attributeName="y"
|
|
56
|
-
attributeType="XML"
|
|
57
|
-
values="13; 5; 13"
|
|
58
|
-
begin="0.3s"
|
|
59
|
-
dur="0.6s"
|
|
60
|
-
repeatCount="indefinite"
|
|
61
|
-
/>
|
|
62
|
-
</rect>
|
|
63
|
-
</svg>
|
|
64
|
-
</template>
|
|
65
|
-
<script lang="ts" setup>
|
|
66
|
-
import {
|
|
67
|
-
withDefaults(
|
|
68
|
-
defineProps<{
|
|
69
|
-
color?: string
|
|
70
|
-
height?: number
|
|
71
|
-
width?: number
|
|
72
|
-
}>(),
|
|
73
|
-
{
|
|
74
|
-
color: '#000',
|
|
75
|
-
height: 40,
|
|
76
|
-
width: 40
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
viewBox="0 0 30 30"
|
|
5
|
+
:height="height"
|
|
6
|
+
:width="width"
|
|
7
|
+
:fill="color"
|
|
8
|
+
>
|
|
9
|
+
<rect x="0" y="13" width="4" height="5">
|
|
10
|
+
<animate
|
|
11
|
+
attributeName="height"
|
|
12
|
+
attributeType="XML"
|
|
13
|
+
values="5;21;5"
|
|
14
|
+
begin="0s"
|
|
15
|
+
dur="0.6s"
|
|
16
|
+
repeatCount="indefinite"
|
|
17
|
+
/>
|
|
18
|
+
<animate
|
|
19
|
+
attributeName="y"
|
|
20
|
+
attributeType="XML"
|
|
21
|
+
values="13; 5; 13"
|
|
22
|
+
begin="0s"
|
|
23
|
+
dur="0.6s"
|
|
24
|
+
repeatCount="indefinite"
|
|
25
|
+
/>
|
|
26
|
+
</rect>
|
|
27
|
+
<rect x="10" y="13" width="4" height="5">
|
|
28
|
+
<animate
|
|
29
|
+
attributeName="height"
|
|
30
|
+
attributeType="XML"
|
|
31
|
+
values="5;21;5"
|
|
32
|
+
begin="0.15s"
|
|
33
|
+
dur="0.6s"
|
|
34
|
+
repeatCount="indefinite"
|
|
35
|
+
/>
|
|
36
|
+
<animate
|
|
37
|
+
attributeName="y"
|
|
38
|
+
attributeType="XML"
|
|
39
|
+
values="13; 5; 13"
|
|
40
|
+
begin="0.15s"
|
|
41
|
+
dur="0.6s"
|
|
42
|
+
repeatCount="indefinite"
|
|
43
|
+
/>
|
|
44
|
+
</rect>
|
|
45
|
+
<rect x="20" y="13" width="4" height="5">
|
|
46
|
+
<animate
|
|
47
|
+
attributeName="height"
|
|
48
|
+
attributeType="XML"
|
|
49
|
+
values="5;21;5"
|
|
50
|
+
begin="0.3s"
|
|
51
|
+
dur="0.6s"
|
|
52
|
+
repeatCount="indefinite"
|
|
53
|
+
/>
|
|
54
|
+
<animate
|
|
55
|
+
attributeName="y"
|
|
56
|
+
attributeType="XML"
|
|
57
|
+
values="13; 5; 13"
|
|
58
|
+
begin="0.3s"
|
|
59
|
+
dur="0.6s"
|
|
60
|
+
repeatCount="indefinite"
|
|
61
|
+
/>
|
|
62
|
+
</rect>
|
|
63
|
+
</svg>
|
|
64
|
+
</template>
|
|
65
|
+
<script lang="ts" setup>
|
|
66
|
+
import { withDefaults } from 'vue'
|
|
67
|
+
withDefaults(
|
|
68
|
+
defineProps<{
|
|
69
|
+
color?: string
|
|
70
|
+
height?: number
|
|
71
|
+
width?: number
|
|
72
|
+
}>(),
|
|
73
|
+
{
|
|
74
|
+
color: '#000',
|
|
75
|
+
height: 40,
|
|
76
|
+
width: 40
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
</script>
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
viewBox="0 0 120 30"
|
|
4
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
-
:fill="color"
|
|
6
|
-
:width="width"
|
|
7
|
-
:height="height"
|
|
8
|
-
>
|
|
9
|
-
<circle cx="15" cy="15" r="15">
|
|
10
|
-
<animate
|
|
11
|
-
attributeName="r"
|
|
12
|
-
from="15"
|
|
13
|
-
to="15"
|
|
14
|
-
begin="0s"
|
|
15
|
-
dur="0.8s"
|
|
16
|
-
values="15;9;15"
|
|
17
|
-
calcMode="linear"
|
|
18
|
-
repeatCount="indefinite"
|
|
19
|
-
/>
|
|
20
|
-
<animate
|
|
21
|
-
attributeName="fill-opacity"
|
|
22
|
-
from="1"
|
|
23
|
-
to="1"
|
|
24
|
-
begin="0s"
|
|
25
|
-
dur="0.8s"
|
|
26
|
-
values="1;.5;1"
|
|
27
|
-
calcMode="linear"
|
|
28
|
-
repeatCount="indefinite"
|
|
29
|
-
/>
|
|
30
|
-
</circle>
|
|
31
|
-
<circle cx="60" cy="15" r="9" fill-opacity="0.3">
|
|
32
|
-
<animate
|
|
33
|
-
attributeName="r"
|
|
34
|
-
from="9"
|
|
35
|
-
to="9"
|
|
36
|
-
begin="0s"
|
|
37
|
-
dur="0.8s"
|
|
38
|
-
values="9;15;9"
|
|
39
|
-
calcMode="linear"
|
|
40
|
-
repeatCount="indefinite"
|
|
41
|
-
/>
|
|
42
|
-
<animate
|
|
43
|
-
attributeName="fill-opacity"
|
|
44
|
-
from="0.5"
|
|
45
|
-
to="0.5"
|
|
46
|
-
begin="0s"
|
|
47
|
-
dur="0.8s"
|
|
48
|
-
values=".5;1;.5"
|
|
49
|
-
calcMode="linear"
|
|
50
|
-
repeatCount="indefinite"
|
|
51
|
-
/>
|
|
52
|
-
</circle>
|
|
53
|
-
<circle cx="105" cy="15" r="15">
|
|
54
|
-
<animate
|
|
55
|
-
attributeName="r"
|
|
56
|
-
from="15"
|
|
57
|
-
to="15"
|
|
58
|
-
begin="0s"
|
|
59
|
-
dur="0.8s"
|
|
60
|
-
values="15;9;15"
|
|
61
|
-
calcMode="linear"
|
|
62
|
-
repeatCount="indefinite"
|
|
63
|
-
/>
|
|
64
|
-
<animate
|
|
65
|
-
attributeName="fill-opacity"
|
|
66
|
-
from="1"
|
|
67
|
-
to="1"
|
|
68
|
-
begin="0s"
|
|
69
|
-
dur="0.8s"
|
|
70
|
-
values="1;.5;1"
|
|
71
|
-
calcMode="linear"
|
|
72
|
-
repeatCount="indefinite"
|
|
73
|
-
/>
|
|
74
|
-
</circle>
|
|
75
|
-
</svg>
|
|
76
|
-
</template>
|
|
77
|
-
|
|
78
|
-
<script lang="ts" setup>
|
|
79
|
-
import {
|
|
80
|
-
withDefaults(
|
|
81
|
-
defineProps<{
|
|
82
|
-
color?: string
|
|
83
|
-
height?: number
|
|
84
|
-
width?: number
|
|
85
|
-
}>(),
|
|
86
|
-
{
|
|
87
|
-
color: '#000',
|
|
88
|
-
height: 240,
|
|
89
|
-
width: 60
|
|
90
|
-
}
|
|
91
|
-
)
|
|
92
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
viewBox="0 0 120 30"
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
:fill="color"
|
|
6
|
+
:width="width"
|
|
7
|
+
:height="height"
|
|
8
|
+
>
|
|
9
|
+
<circle cx="15" cy="15" r="15">
|
|
10
|
+
<animate
|
|
11
|
+
attributeName="r"
|
|
12
|
+
from="15"
|
|
13
|
+
to="15"
|
|
14
|
+
begin="0s"
|
|
15
|
+
dur="0.8s"
|
|
16
|
+
values="15;9;15"
|
|
17
|
+
calcMode="linear"
|
|
18
|
+
repeatCount="indefinite"
|
|
19
|
+
/>
|
|
20
|
+
<animate
|
|
21
|
+
attributeName="fill-opacity"
|
|
22
|
+
from="1"
|
|
23
|
+
to="1"
|
|
24
|
+
begin="0s"
|
|
25
|
+
dur="0.8s"
|
|
26
|
+
values="1;.5;1"
|
|
27
|
+
calcMode="linear"
|
|
28
|
+
repeatCount="indefinite"
|
|
29
|
+
/>
|
|
30
|
+
</circle>
|
|
31
|
+
<circle cx="60" cy="15" r="9" fill-opacity="0.3">
|
|
32
|
+
<animate
|
|
33
|
+
attributeName="r"
|
|
34
|
+
from="9"
|
|
35
|
+
to="9"
|
|
36
|
+
begin="0s"
|
|
37
|
+
dur="0.8s"
|
|
38
|
+
values="9;15;9"
|
|
39
|
+
calcMode="linear"
|
|
40
|
+
repeatCount="indefinite"
|
|
41
|
+
/>
|
|
42
|
+
<animate
|
|
43
|
+
attributeName="fill-opacity"
|
|
44
|
+
from="0.5"
|
|
45
|
+
to="0.5"
|
|
46
|
+
begin="0s"
|
|
47
|
+
dur="0.8s"
|
|
48
|
+
values=".5;1;.5"
|
|
49
|
+
calcMode="linear"
|
|
50
|
+
repeatCount="indefinite"
|
|
51
|
+
/>
|
|
52
|
+
</circle>
|
|
53
|
+
<circle cx="105" cy="15" r="15">
|
|
54
|
+
<animate
|
|
55
|
+
attributeName="r"
|
|
56
|
+
from="15"
|
|
57
|
+
to="15"
|
|
58
|
+
begin="0s"
|
|
59
|
+
dur="0.8s"
|
|
60
|
+
values="15;9;15"
|
|
61
|
+
calcMode="linear"
|
|
62
|
+
repeatCount="indefinite"
|
|
63
|
+
/>
|
|
64
|
+
<animate
|
|
65
|
+
attributeName="fill-opacity"
|
|
66
|
+
from="1"
|
|
67
|
+
to="1"
|
|
68
|
+
begin="0s"
|
|
69
|
+
dur="0.8s"
|
|
70
|
+
values="1;.5;1"
|
|
71
|
+
calcMode="linear"
|
|
72
|
+
repeatCount="indefinite"
|
|
73
|
+
/>
|
|
74
|
+
</circle>
|
|
75
|
+
</svg>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<script lang="ts" setup>
|
|
79
|
+
import { withDefaults } from 'vue'
|
|
80
|
+
withDefaults(
|
|
81
|
+
defineProps<{
|
|
82
|
+
color?: string
|
|
83
|
+
height?: number
|
|
84
|
+
width?: number
|
|
85
|
+
}>(),
|
|
86
|
+
{
|
|
87
|
+
color: '#000',
|
|
88
|
+
height: 240,
|
|
89
|
+
width: 60
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
</script>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Spinner from './spinner.vue'
|
|
2
|
-
import Dots from './dots.vue'
|
|
3
|
-
import Bars from './bars.vue'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
spinner: Spinner,
|
|
7
|
-
dots: Dots,
|
|
8
|
-
bars: Bars
|
|
9
|
-
}
|
|
1
|
+
import Spinner from './spinner.vue'
|
|
2
|
+
import Dots from './dots.vue'
|
|
3
|
+
import Bars from './bars.vue'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
spinner: Spinner,
|
|
7
|
+
dots: Dots,
|
|
8
|
+
bars: Bars
|
|
9
|
+
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
viewBox="0 0 38 38"
|
|
4
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
-
:width="width"
|
|
6
|
-
:height="height"
|
|
7
|
-
:stroke="color"
|
|
8
|
-
>
|
|
9
|
-
<g fill="none" fill-rule="evenodd">
|
|
10
|
-
<g transform="translate(1 1)" stroke-width="2">
|
|
11
|
-
<circle stroke-opacity=".25" cx="18" cy="18" r="18" />
|
|
12
|
-
<path d="M36 18c0-9.94-8.06-18-18-18">
|
|
13
|
-
<animateTransform
|
|
14
|
-
attributeName="transform"
|
|
15
|
-
type="rotate"
|
|
16
|
-
from="0 18 18"
|
|
17
|
-
to="360 18 18"
|
|
18
|
-
dur="0.8s"
|
|
19
|
-
repeatCount="indefinite"
|
|
20
|
-
/>
|
|
21
|
-
</path>
|
|
22
|
-
</g>
|
|
23
|
-
</g>
|
|
24
|
-
</svg>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script lang="ts" setup>
|
|
28
|
-
import {
|
|
29
|
-
withDefaults(
|
|
30
|
-
defineProps<{
|
|
31
|
-
color?: string
|
|
32
|
-
height?: number
|
|
33
|
-
width?: number
|
|
34
|
-
}>(),
|
|
35
|
-
{
|
|
36
|
-
color: '#000',
|
|
37
|
-
height: 64,
|
|
38
|
-
width: 64
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
viewBox="0 0 38 38"
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
:width="width"
|
|
6
|
+
:height="height"
|
|
7
|
+
:stroke="color"
|
|
8
|
+
>
|
|
9
|
+
<g fill="none" fill-rule="evenodd">
|
|
10
|
+
<g transform="translate(1 1)" stroke-width="2">
|
|
11
|
+
<circle stroke-opacity=".25" cx="18" cy="18" r="18" />
|
|
12
|
+
<path d="M36 18c0-9.94-8.06-18-18-18">
|
|
13
|
+
<animateTransform
|
|
14
|
+
attributeName="transform"
|
|
15
|
+
type="rotate"
|
|
16
|
+
from="0 18 18"
|
|
17
|
+
to="360 18 18"
|
|
18
|
+
dur="0.8s"
|
|
19
|
+
repeatCount="indefinite"
|
|
20
|
+
/>
|
|
21
|
+
</path>
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
</svg>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
import { withDefaults } from 'vue'
|
|
29
|
+
withDefaults(
|
|
30
|
+
defineProps<{
|
|
31
|
+
color?: string
|
|
32
|
+
height?: number
|
|
33
|
+
width?: number
|
|
34
|
+
}>(),
|
|
35
|
+
{
|
|
36
|
+
color: '#000',
|
|
37
|
+
height: 64,
|
|
38
|
+
width: 64
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
</script>
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="stack-tab__header-button"
|
|
4
|
-
:class="{
|
|
5
|
-
'stack-tab__shadow-right': shadow === 'right',
|
|
6
|
-
'stack-tab__shadow-left': shadow === 'left'
|
|
7
|
-
}"
|
|
8
|
-
:disabled="disabled ? 'disabled' : null"
|
|
9
|
-
:title="title"
|
|
10
|
-
>
|
|
11
|
-
<div v-if="!('icon' in $slots)" class="stack-tab__mask-button" :class="iconClass" />
|
|
12
|
-
<div v-if="'icon' in $slots" class="stack-tab__button">
|
|
13
|
-
<slot name="icon" />
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script lang="ts" setup>
|
|
19
|
-
withDefaults(
|
|
20
|
-
defineProps<{
|
|
21
|
-
// 是否禁用
|
|
22
|
-
disabled?: boolean
|
|
23
|
-
shadow?: string | null
|
|
24
|
-
iconClass?: string
|
|
25
|
-
title?: string
|
|
26
|
-
}>(),
|
|
27
|
-
{
|
|
28
|
-
disabled: false,
|
|
29
|
-
shadow: null,
|
|
30
|
-
iconClass: ''
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<style scoped></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="stack-tab__header-button"
|
|
4
|
+
:class="{
|
|
5
|
+
'stack-tab__shadow-right': shadow === 'right',
|
|
6
|
+
'stack-tab__shadow-left': shadow === 'left'
|
|
7
|
+
}"
|
|
8
|
+
:disabled="disabled ? 'disabled' : null"
|
|
9
|
+
:title="title"
|
|
10
|
+
>
|
|
11
|
+
<div v-if="!('icon' in $slots)" class="stack-tab__mask-button" :class="iconClass" />
|
|
12
|
+
<div v-if="'icon' in $slots" class="stack-tab__button">
|
|
13
|
+
<slot name="icon" />
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
withDefaults(
|
|
20
|
+
defineProps<{
|
|
21
|
+
// 是否禁用
|
|
22
|
+
disabled?: boolean
|
|
23
|
+
shadow?: string | null
|
|
24
|
+
iconClass?: string
|
|
25
|
+
title?: string
|
|
26
|
+
}>(),
|
|
27
|
+
{
|
|
28
|
+
disabled: false,
|
|
29
|
+
shadow: null,
|
|
30
|
+
iconClass: ''
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style scoped></style>
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li
|
|
3
|
-
ref="curtab"
|
|
4
|
-
class="stack-tab__item"
|
|
5
|
-
:class="{
|
|
6
|
-
'is-active': item.active,
|
|
7
|
-
'is-icon': item.closable
|
|
8
|
-
}"
|
|
9
|
-
@click="activeTab"
|
|
10
|
-
>
|
|
11
|
-
<!-- <div v-if="!!icon" class="stack-tab__item-icon" :class="icon"></div>-->
|
|
12
|
-
<div class="stack-tab__item-title">
|
|
13
|
-
<div class="stack-tab__item-title-content" :title="title">
|
|
14
|
-
{{ title }}
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
<div
|
|
18
|
-
v-if="item.closable"
|
|
19
|
-
class="stack-tab__icon-close-fill stack-tab__item-button"
|
|
20
|
-
:title="t('VueStackTab.close')"
|
|
21
|
-
@click.stop="closeTab"
|
|
22
|
-
/>
|
|
23
|
-
</li>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script setup lang="ts" name="TabHeaderItem">
|
|
27
|
-
import { computed, ref, watch } from 'vue'
|
|
28
|
-
import type { ITabItem } from '@/lib/model/TabModel'
|
|
29
|
-
import localeI18n from '@/lib/i18n'
|
|
30
|
-
// 消息
|
|
31
|
-
const emit = defineEmits(['close', 'active'])
|
|
32
|
-
|
|
33
|
-
const { t } = localeI18n().getI18n()
|
|
34
|
-
const curtab = ref<HTMLElement>()
|
|
35
|
-
const props = defineProps<{
|
|
36
|
-
item: ITabItem
|
|
37
|
-
}>()
|
|
38
|
-
/**
|
|
39
|
-
* 如果Active为true,就看看
|
|
40
|
-
*/
|
|
41
|
-
watch(
|
|
42
|
-
() => props.item.active,
|
|
43
|
-
(val) => {
|
|
44
|
-
if (val) {
|
|
45
|
-
activeTab()
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
const title = computed<string>(() => {
|
|
50
|
-
return props.item.title || t('undefined')
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const closeTab = () => {
|
|
54
|
-
emit('close', props.item)
|
|
55
|
-
}
|
|
56
|
-
const activeTab = () => {
|
|
57
|
-
// if (!props.active) {
|
|
58
|
-
emit('active', props.item, curtab)
|
|
59
|
-
// }
|
|
60
|
-
}
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<style lang="scss" scoped></style>
|
|
1
|
+
<template>
|
|
2
|
+
<li
|
|
3
|
+
ref="curtab"
|
|
4
|
+
class="stack-tab__item"
|
|
5
|
+
:class="{
|
|
6
|
+
'is-active': item.active,
|
|
7
|
+
'is-icon': item.closable
|
|
8
|
+
}"
|
|
9
|
+
@click="activeTab"
|
|
10
|
+
>
|
|
11
|
+
<!-- <div v-if="!!icon" class="stack-tab__item-icon" :class="icon"></div>-->
|
|
12
|
+
<div class="stack-tab__item-title">
|
|
13
|
+
<div class="stack-tab__item-title-content" :title="title">
|
|
14
|
+
{{ title }}
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div
|
|
18
|
+
v-if="item.closable"
|
|
19
|
+
class="stack-tab__icon-close-fill stack-tab__item-button"
|
|
20
|
+
:title="t('VueStackTab.close')"
|
|
21
|
+
@click.stop="closeTab"
|
|
22
|
+
/>
|
|
23
|
+
</li>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup lang="ts" name="TabHeaderItem">
|
|
27
|
+
import { computed, ref, watch } from 'vue'
|
|
28
|
+
import type { ITabItem } from '@/lib/model/TabModel'
|
|
29
|
+
import localeI18n from '@/lib/i18n'
|
|
30
|
+
// 消息
|
|
31
|
+
const emit = defineEmits(['close', 'active'])
|
|
32
|
+
|
|
33
|
+
const { t } = localeI18n().getI18n()
|
|
34
|
+
const curtab = ref<HTMLElement>()
|
|
35
|
+
const props = defineProps<{
|
|
36
|
+
item: ITabItem
|
|
37
|
+
}>()
|
|
38
|
+
/**
|
|
39
|
+
* 如果Active为true,就看看
|
|
40
|
+
*/
|
|
41
|
+
watch(
|
|
42
|
+
() => props.item.active,
|
|
43
|
+
(val) => {
|
|
44
|
+
if (val) {
|
|
45
|
+
activeTab()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
const title = computed<string>(() => {
|
|
50
|
+
return props.item.title || t('undefined')
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const closeTab = () => {
|
|
54
|
+
emit('close', props.item)
|
|
55
|
+
}
|
|
56
|
+
const activeTab = () => {
|
|
57
|
+
// if (!props.active) {
|
|
58
|
+
emit('active', props.item, curtab)
|
|
59
|
+
// }
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss" scoped></style>
|