|
1 | 1 | <template> |
2 | | - <div class="flex flex-col flex-1 h-auto overflow-y-hidden flex-nowrap"> |
| 2 | + <div class="flex h-auto flex-1 flex-col flex-nowrap overflow-y-hidden"> |
3 | 3 | <div |
4 | | - class="sticky top-0 z-10 flex-shrink-0 overflow-x-auto tabs group-tabs divide-x divide-dividerLight bg-primaryLight" |
| 4 | + class="tabs group-tabs sticky top-0 z-10 flex-shrink-0 divide-x divide-dividerLight overflow-x-auto bg-primaryLight" |
5 | 5 | > |
6 | 6 | <div |
7 | | - class="flex flex-1 flex-shrink-0 w-0 overflow-hidden" |
| 7 | + class="flex w-0 flex-1 flex-shrink-0 overflow-hidden" |
8 | 8 | ref="scrollContainer" |
9 | 9 | > |
10 | 10 | <div |
|
17 | 17 | :list="tabEntries" |
18 | 18 | :style="tabStyles" |
19 | 19 | :item-key="'window-'" |
20 | | - class="flex flex-shrink-0 overflow-x-auto divide-x divide-dividerLight transition" |
| 20 | + class="flex flex-shrink-0 divide-x divide-dividerLight overflow-x-auto transition" |
21 | 21 | @sort="sortTabs" |
22 | 22 | > |
23 | 23 | <template #item="{ element: [tabID, tabMeta] }"> |
|
33 | 33 | > |
34 | 34 | <span |
35 | 35 | v-if="tabMeta.icon" |
36 | | - class="flex items-center justify-center cursor-pointer" |
| 36 | + class="flex cursor-pointer items-center justify-center" |
37 | 37 | > |
38 | | - <component :is="tabMeta.icon" class="w-4 h-4 svg-icons" /> |
| 38 | + <component :is="tabMeta.icon" class="svg-icons h-4 w-4" /> |
39 | 39 | </span> |
40 | 40 |
|
41 | 41 | <div |
42 | 42 | v-if="!tabMeta.tabhead" |
43 | | - class="w-full px-2 text-left truncate" |
| 43 | + class="w-full truncate px-2 text-left" |
44 | 44 | > |
45 | 45 | <span class="truncate"> |
46 | 46 | {{ tabMeta.label }} |
47 | 47 | </span> |
48 | 48 | </div> |
49 | 49 |
|
50 | | - <div v-else class="w-full text-left truncate"> |
| 50 | + <div v-else class="w-full truncate text-left"> |
51 | 51 | <component :is="tabMeta.tabhead" /> |
52 | 52 | </div> |
53 | 53 |
|
|
81 | 81 | </draggable> |
82 | 82 | </div> |
83 | 83 | <div |
84 | | - class="sticky right-0 z-20 flex items-center justify-center flex-shrink-0 overflow-x-auto" |
| 84 | + class="sticky right-0 z-20 flex flex-shrink-0 items-center justify-center overflow-x-auto" |
85 | 85 | > |
86 | 86 | <span |
87 | 87 | v-if="canAddNewTab" |
|
109 | 109 | min="1" |
110 | 110 | :max="MAX_SCROLL_VALUE" |
111 | 111 | v-model="thumbPosition" |
112 | | - class="absolute bottom-0 left-0 hidden slider" |
| 112 | + class="slider absolute bottom-0 left-0 hidden" |
113 | 113 | :class="{ |
114 | 114 | '!block': scrollThumb.show, |
115 | 115 | }" |
|
122 | 122 | id="myRange" |
123 | 123 | /> |
124 | 124 | </div> |
125 | | - <div class="w-full h-full contents"> |
| 125 | + <div class="contents h-full w-full"> |
126 | 126 | <slot></slot> |
127 | 127 | </div> |
128 | 128 | </div> |
@@ -306,7 +306,12 @@ const scroll = (e: WheelEvent) => { |
306 | 306 | scrollContainer.value!.scrollLeft += e.deltaY |
307 | 307 | scrollContainer.value!.scrollLeft += e.deltaX |
308 | 308 |
|
309 | | - const { scrollWidth, clientWidth, scrollLeft } = scrollContainer.value! |
| 309 | + const { scrollWidth, clientWidth, scrollLeft } = scrollContainer.value || { |
| 310 | + scrollWidth: 0, |
| 311 | + clientWidth: 0, |
| 312 | + scrollLeft: 0, |
| 313 | + } |
| 314 | +
|
310 | 315 | const maxScroll = scrollWidth - clientWidth |
311 | 316 | thumbPosition.value = (scrollLeft / maxScroll) * MAX_SCROLL_VALUE |
312 | 317 | } |
|
0 commit comments