@mptw/skylens-ui 1.4.14 → 1.4.15
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/components/SLTab.vue +12 -3
- package/components/SLTabs.vue +4 -0
- package/package.json +1 -1
package/components/SLTab.vue
CHANGED
|
@@ -7,7 +7,8 @@ li(
|
|
|
7
7
|
ref='tabPaneEl'
|
|
8
8
|
)
|
|
9
9
|
a(
|
|
10
|
-
href="javascript:;"
|
|
10
|
+
href="javascript:;",
|
|
11
|
+
:class='{ disabled: disabled }'
|
|
11
12
|
).tab-nav-item-link
|
|
12
13
|
.tab-nav-item-link-title
|
|
13
14
|
.inline-flex.items-center.justify-center.w-full.space-x-1
|
|
@@ -63,9 +64,13 @@ export default defineComponent({
|
|
|
63
64
|
type: Boolean,
|
|
64
65
|
default: false,
|
|
65
66
|
},
|
|
67
|
+
disabled: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false,
|
|
70
|
+
},
|
|
66
71
|
},
|
|
67
72
|
setup(props) {
|
|
68
|
-
const { order, activeTabBorderColor, single } = toRefs(props);
|
|
73
|
+
const { order, activeTabBorderColor, single, disabled } = toRefs(props);
|
|
69
74
|
|
|
70
75
|
const distributed = inject<{
|
|
71
76
|
header: boolean;
|
|
@@ -98,11 +103,15 @@ export default defineComponent({
|
|
|
98
103
|
classes.push("single");
|
|
99
104
|
}
|
|
100
105
|
|
|
106
|
+
if (disabled.value) {
|
|
107
|
+
classes.push("disabled");
|
|
108
|
+
}
|
|
109
|
+
|
|
101
110
|
return classes.join(" ");
|
|
102
111
|
});
|
|
103
112
|
|
|
104
113
|
function navClick() {
|
|
105
|
-
if (!isActive.value && distributed && distributed.changeTabTo) {
|
|
114
|
+
if (!isActive.value && distributed && distributed.changeTabTo && !disabled.value) {
|
|
106
115
|
distributed.changeTabTo(index.value || 0);
|
|
107
116
|
}
|
|
108
117
|
}
|
package/components/SLTabs.vue
CHANGED