Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

No margin-top if there are no column or search options #18

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions js/Components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ export default {
hasSearchRows() {
return Object.keys(this.search || {}).length > 0;
},

onlyData() {
if (this.hasFilters || this.hasColumns || this.hasSearchRows) {
return false;
}

if (!this.search) {
return true;
}

return this.search.global ? false : true;
},
},

data() {
Expand Down
2 changes: 1 addition & 1 deletion js/Tailwind2/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ table >>> tr:hover td {
</slot>

<slot name="tableWrapper" :meta="meta">
<TableWrapper>
<TableWrapper :class="{'mt-2': !onlyData}">
<slot name="table">
<table class="min-w-full divide-y divide-gray-200 bg-white">
<thead class="bg-gray-50">
Expand Down
2 changes: 1 addition & 1 deletion js/Tailwind2/TableWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="flex flex-col mt-2">
<div class="flex flex-col">
<div class="-my-2 sm:-mx-6 lg:-mx-8">
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
<div class="shadow border-b border-gray-200 relative">
Expand Down