Skip to content

Commit 9862fba

Browse files
committed
table row type
1 parent 9ff5d6a commit 9862fba

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

dev/pages/Home.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,14 @@ import {
227227
228228
import { useValidator } from '@zemkogabor/vue-form-validator'
229229
import { ref, defineComponent } from 'vue'
230+
231+
type TableItem = {
232+
id: number;
233+
name: string;
234+
_showRowDetails?: boolean;
235+
rowDetails?: string;
236+
}
237+
230238
export default defineComponent({
231239
name: 'Home',
232240
components: {
@@ -330,12 +338,7 @@ export default defineComponent({
330338
{ id: 2, name: 'George' },
331339
{ id: 3, name: 'Paul', _showRowDetails: true, rowDetails: 'Paul Jackson' },
332340
{ id: 4, name: 'Ringo' },
333-
] as {
334-
id: number;
335-
name: string;
336-
_showRowDetails?: boolean;
337-
rowDetails?: string;
338-
}[],
341+
] as TableItem[],
339342
}
340343
},
341344
methods: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bootstrap-vue-wrapper",
3-
"version": "3.0.4",
3+
"version": "3.0.5",
44
"description": "Bootstrap 5 components in Vue3 wrapper.",
55
"module": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/components/bs-table/BsTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<script lang="ts">
7676
import { defineComponent, type PropType } from 'vue'
7777
import type Field from '@/types/Field.ts'
78-
import type TableRow from '@/types/TableRow.ts'
78+
import type { TableRow } from '@/types/TableRow.ts'
7979
8080
export default defineComponent({
8181
name: 'BsTable',

src/ssr-safe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export { default as BsRadio } from './components/bs-radio/BsRadio.vue'
1111
export type { default as BreadCrumbItem } from './types/BreadcrumbItem.ts'
1212
export type { default as Option } from './types/Option.ts'
1313
export type { default as Field } from './types/Field.ts'
14-
export type { default as TableRow } from './types/TableRow.ts'
14+
export type { TableRow, TableRowMeta } from './types/TableRow.ts'

src/types/TableRow.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
export default interface TableRow {
1+
export interface TableRowMeta {
22
trClass?: string;
33
id?: string | number;
44
_showRowDetails?: boolean;
5-
[key: string]: object | string | number | boolean | undefined | null;
5+
}
6+
7+
export type TableRow = TableRowMeta & {
8+
[key: string]: unknown;
69
}

0 commit comments

Comments
 (0)