@aquiferre/ui-kit 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/DataTable.vue +4 -2
- package/package.json +1 -1
package/components/DataTable.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="table-container" :class="{ relative: loading }" :data-testid="baseTestId">
|
|
3
|
-
<table class="table">
|
|
2
|
+
<div class="table-container" :class="{ relative: loading, 'overflow-x-auto': scrollable }" :data-testid="baseTestId">
|
|
3
|
+
<table class="table" :class="{ 'min-w-full': scrollable, 'w-full': !scrollable }">
|
|
4
4
|
<thead class="table-header">
|
|
5
5
|
<tr>
|
|
6
6
|
<th v-if="selectable" class="table-header-cell w-8">
|
|
@@ -82,6 +82,7 @@ const props = withDefaults(defineProps<{
|
|
|
82
82
|
sort?: { field: string; order: 'asc' | 'desc' } | null
|
|
83
83
|
rowTestIdPrefix?: string
|
|
84
84
|
testId?: string
|
|
85
|
+
scrollable?: boolean
|
|
85
86
|
}>(), {
|
|
86
87
|
loading: false,
|
|
87
88
|
emptyText: '暂无数据',
|
|
@@ -90,6 +91,7 @@ const props = withDefaults(defineProps<{
|
|
|
90
91
|
rowKey: 'id',
|
|
91
92
|
sort: null,
|
|
92
93
|
rowTestIdPrefix: undefined,
|
|
94
|
+
scrollable: false,
|
|
93
95
|
})
|
|
94
96
|
|
|
95
97
|
const attrs = useAttrs()
|