Skip to content

Commit

Permalink
Merge pull request #17 from greg0x46/master
Browse files Browse the repository at this point in the history
add row cssClasses
  • Loading branch information
abordage authored Mar 26, 2023
2 parents 982f5d8 + 40f4e53 commit ff8d950
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class MyTableCard extends TableCard
$rows[] = [
'title' => $model->name,
'subtitle' => $model->email,
'cssClasses' => ['text-red-500'],
'viewUrl' => $this->getResourceUrl($model),
'editUrl' => $this->getResourceUrl($model) . '/edit',
];
Expand Down
2 changes: 1 addition & 1 deletion dist/js/card.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions resources/js/components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<table v-if="card.rows.length" class="w-full table-default" cellpadding="0" cellspacing="0" data-testid="resource-table">
<tr v-for="item in card.rows" class="group">

<td class="
text-left
text-90
Expand All @@ -15,7 +14,9 @@
dark:border-gray-700
dark:bg-gray-800
group-hover:bg-gray-50
dark:group-hover:bg-gray-900">
dark:group-hover:bg-gray-900"
:class="item.cssClasses"
>
{{ item.title }}
<div v-if="item.subtitle" class="text-xs text-gray-400">{{ item.subtitle }}</div>
</td>
Expand Down

0 comments on commit ff8d950

Please sign in to comment.