fix matrix input (#556)

* fix matrix input

* Fix matrix responsiveness

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka 2024-09-04 10:51:38 +01:00 committed by GitHub
parent f334a2696d
commit 3fb961af0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 10 deletions

View File

@ -4,7 +4,7 @@
<slot name="label" /> <slot name="label" />
</template> </template>
<div <div
class="border border-gray-300" class="border border-gray-300 overflow-x-auto"
:class="[ :class="[
theme.default.borderRadius, theme.default.borderRadius,
{ {
@ -13,18 +13,16 @@
}, },
]" ]"
> >
<table <table class="w-full table-auto">
class="w-full table-fixed overflow-hidden"
>
<thead class=""> <thead class="">
<tr> <tr>
<th /> <th class="text-left p-2 w-auto max-w-xs" />
<td <td
v-for="column in columns" v-for="column in columns"
:key="column" :key="column"
class="border-l border-gray-300" class="border-l border-gray-300 max-w-24 overflow-hidden"
> >
<div class="p-2 w-full flex items-center justify-center capitalize text-sm truncate"> <div class="p-2 w-full flex items-center justify-center text-sm">
{{ column }} {{ column }}
</div> </div>
</td> </td>
@ -37,8 +35,8 @@
:key="rowIndex" :key="rowIndex"
class="border-t border-gray-300" class="border-t border-gray-300"
> >
<td> <td class="text-left w-auto max-w-24 overflow-hidden">
<div class="w-full flex-grow p-2 text-sm truncate"> <div class="w-full p-2 text-sm">
{{ row }} {{ row }}
</div> </div>
</td> </td>
@ -103,7 +101,7 @@ export default {
} }
}, },
computed: {}, computed: {},
beforeMount() { mounted() {
if (!this.compVal || typeof this.compVal !== 'object') { if (!this.compVal || typeof this.compVal !== 'object') {
this.compVal = {} this.compVal = {}
} }