Skip to content

Commit c1dc4ee

Browse files
author
issayah
committed
BTable non-renderer fns script setup conversion
1 parent a5dc039 commit c1dc4ee

File tree

6 files changed

+29
-15
lines changed

6 files changed

+29
-15
lines changed

src/components/BTable/BTbody.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
</template>
66

77
<script setup lang="ts">
8+
// import type {BTBodyProps} from '@/types/components'
89
import {computed} from 'vue'
910
10-
const props = defineProps({
11-
headVariant: {type: Boolean, default: false},
11+
interface BTBodyProps {
12+
headVariant?: boolean
13+
}
14+
15+
const props = withDefaults(defineProps<BTBodyProps>(), {
16+
headVariant: false,
1217
})
1318
1419
const classes = computed(() => ({

src/components/BTable/BTfoot.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
</template>
66

77
<script setup lang="ts">
8+
// import type {BTfootProps} from '@/types/components'
89
import {computed} from 'vue'
910
10-
const props = defineProps({
11-
footVariant: {type: String},
12-
})
11+
interface BTfootProps {
12+
footVariant: string
13+
}
14+
15+
const props = defineProps<BTfootProps>()
1316
1417
const classes = computed(() => ({
1518
[`table-${props.footVariant}`]: props.footVariant,

src/components/BTable/BThead.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
</template>
66

77
<script setup lang="ts">
8+
// import type {BTheadProps} from '@/types/components'
89
import {computed} from 'vue'
910
10-
const props = defineProps({
11-
headVariant: {type: String},
12-
})
11+
interface BTheadProps {
12+
headVariant: string
13+
}
14+
15+
const props = defineProps<BTheadProps>()
1316
1417
const classes = computed(() => ({
1518
[`table-${props.headVariant}`]: props.headVariant,

src/components/BTable/BTr.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
</template>
66

77
<script setup lang="ts">
8+
// import type {BTrProps} from '@/types/components'
89
import {computed} from 'vue'
910
10-
const props = defineProps({
11-
variant: {type: String},
12-
})
11+
interface BTrProps {
12+
variant: string
13+
}
14+
15+
const props = defineProps<BTrProps>()
1316
1417
const classes = computed(() => ({
1518
[`table-${props.variant}`]: props.variant,

src/components/BTable/itemHelper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2-
import type {TableField, TableFieldObject, TableItem} from '../../types'
3-
import {isObject, isString} from '../../utils/inspect'
4-
import {startCase} from '../../utils/stringUtils'
2+
import type {TableField, TableFieldObject, TableItem} from '@/types'
3+
import {isObject, isString} from '@/utils/inspect'
4+
import {startCase} from '@/utils/stringUtils'
55

66
const useItemHelper = () => {
77
const normaliseFields = (origFields: TableField[], items: TableItem[]): TableFieldObject[] => {

src/types/components/BTable/BTfoot.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Props
22
export interface Props {
3-
footerVariant: string
3+
footVariant: string
44
}
55
// Emits
66

0 commit comments

Comments
 (0)