@thinkpixellab-public/px-vue 3.0.53 → 3.0.54
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/PxPivot.vue +13 -0
- package/package.json +1 -1
package/components/PxPivot.vue
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
:key="getItemKey(item)"
|
|
18
18
|
:disabled="getItemDisabled(item)"
|
|
19
19
|
@click="itemClick(item)"
|
|
20
|
+
v-bind="getTabAttrs(item)"
|
|
20
21
|
>
|
|
21
22
|
<span :ref="getTabContentRefName(item)">
|
|
22
23
|
<slot :item="item" :selected="isItemSelected(item)">
|
|
@@ -49,9 +50,14 @@ export default {
|
|
|
49
50
|
components: {},
|
|
50
51
|
mixins: [PxBaseResize, PxBaseItemsSelect],
|
|
51
52
|
props: {
|
|
53
|
+
// classes that get set on the tabs and selector line
|
|
52
54
|
tabClass: { type: String, default: 'px-pivot__tab' },
|
|
53
55
|
selectorClass: { type: String, default: 'px-pivot__selector' },
|
|
54
56
|
|
|
57
|
+
// a function that will return attributes that should be set on the tab buttons (takes the
|
|
58
|
+
// button item as an arg)
|
|
59
|
+
tabAttrsFn: { type: Function, default: null },
|
|
60
|
+
|
|
55
61
|
// if true scrolls horizontally when no more room
|
|
56
62
|
scrolls: { type: Boolean, default: true },
|
|
57
63
|
|
|
@@ -139,6 +145,13 @@ export default {
|
|
|
139
145
|
this.animated = false;
|
|
140
146
|
}, 100);
|
|
141
147
|
},
|
|
148
|
+
|
|
149
|
+
getTabAttrs(item) {
|
|
150
|
+
if (this.tabAttrsFn) {
|
|
151
|
+
return this.tabAttrsFn(item);
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
},
|
|
142
155
|
},
|
|
143
156
|
};
|
|
144
157
|
</script>
|