@@ -58,9 +58,11 @@ function setHeight() {
58
58
// Set table height
59
59
Array .prototype .forEach .call (document .getElementsByClassName (' iw-tt' ), (ttEle ) => {
60
60
const outHeight = ttEle .parentElement ?.clientHeight
61
- const headerHeight = ttEle .getElementsByClassName (' iw-tt-header' )[0 ].offsetHeight
61
+ const headerEle = ttEle .getElementsByClassName (' iw-tt-header' )
62
+ const headerHeight = headerEle .length > 0 ? headerEle [0 ].offsetHeight : 0
62
63
Array .prototype .forEach .call (ttEle .getElementsByClassName (' iw-tt-layout' ), (layoutEle ) => {
63
- const toolbarHeight = layoutEle .getElementsByClassName (' iw-tt-toolbar' ).length > 0 ? layoutEle .getElementsByClassName (' iw-tt-toolbar' )[0 ].offsetHeight : 0
64
+ const toolbarEle = layoutEle .getElementsByClassName (' iw-tt-toolbar' )
65
+ const toolbarHeight = toolbarEle .length > 0 ? toolbarEle [0 ].offsetHeight : 0
64
66
const footerHeight = layoutEle .getElementsByClassName (' iw-tt-footer' )[0 ].offsetHeight
65
67
layoutEle .getElementsByClassName (' iw-tt-table' )[0 ].style .height = ` ${outHeight - headerHeight - toolbarHeight - footerHeight }px `
66
68
})
@@ -121,9 +123,11 @@ onMounted(async () => {
121
123
:class =" `${tableConf.styles.tableClass} iw-tt w-full text-sm text-base-content bg-base-100 relative`"
122
124
>
123
125
<div
126
+ v-if =" !tableConf.mini || tableConf.quickSearch"
124
127
:class =" `${tableConf.styles.headerClass} iw-tt-header flex justify-between p-0 min-h-0`"
125
128
>
126
129
<ScrollableComp
130
+ v-if =" !tableConf.mini"
127
131
class =" flex-1"
128
132
>
129
133
<div class =" tablist iw-tabs iw-tabs-sm iw-tabs-boxed" >
@@ -139,13 +143,17 @@ onMounted(async () => {
139
143
</a >
140
144
</div >
141
145
</ScrollableComp >
146
+ <div v-else class =" flex-1" >
147
+   ;
148
+ </div >
142
149
<div class =" flex items-center" >
143
150
<QuickSearchComp
144
151
v-if =" tableConf.quickSearch"
145
152
class =" mx-2"
146
153
:quick-search =" tableConf.quickSearch"
147
154
/>
148
155
<TableSettingComp
156
+ v-if =" !tableConf.mini"
149
157
:table-conf =" tableConf"
150
158
:layout-conf =" currentLayoutConf"
151
159
:layout-columns-conf =" currentLayoutColumnsConf"
@@ -156,7 +164,7 @@ onMounted(async () => {
156
164
<template v-for =" layout in layoutsConf " :key =" layout .id " >
157
165
<div v-show =" currentLayoutId === layout.id" :id =" `iw-tt-layout-${layout.id}`" class =" iw-tt-layout" >
158
166
<div
159
- v-if =" layout.sort || layout.filter"
167
+ v-if =" !tableConf.mini && ( layout.sort || layout.filter) "
160
168
class =" iw-tt-toolbar flex items-center h-8 p-0.5"
161
169
>
162
170
<RowSortSettingComp v-if =" layout.sort" :layout-id =" layout.id" :sort =" layout.sort" :layout-columns-conf =" currentLayoutColumnsConf" />
0 commit comments