Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Commit 0de3c07

Browse files
Merge pull request #18 from protonemedia/wrapper-without-margin-top
No margin-top if there are no column or search options
2 parents 9e019a9 + e0883ec commit 0de3c07

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

‎js/Components/Table.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ export default {
5151
hasSearchRows() {
5252
return Object.keys(this.search || {}).length > 0;
5353
},
54+
55+
onlyData() {
56+
if (this.hasFilters || this.hasColumns || this.hasSearchRows) {
57+
return false;
58+
}
59+
60+
if (!this.search) {
61+
return true;
62+
}
63+
64+
return this.search.global ? false : true;
65+
},
5466
},
5567
5668
data() {

‎js/Tailwind2/Table.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ table >>> tr:hover td {
106106
</slot>
107107

108108
<slot name="tableWrapper" :meta="meta">
109-
<TableWrapper>
109+
<TableWrapper:class="{'mt-2': !onlyData}">
110110
<slot name="table">
111111
<table class="min-w-full divide-y divide-gray-200 bg-white">
112112
<thead class="bg-gray-50">

‎js/Tailwind2/TableWrapper.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="flex flex-col mt-2">
2+
<div class="flex flex-col">
33
<div class="-my-2 sm:-mx-6 lg:-mx-8">
44
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
55
<div class="shadow border-b border-gray-200 relative">

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /