Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 2bfc0fa

Browse files
committed
refactor: function => arrow function
1 parent 7e66a08 commit 2bfc0fa

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

apps/playground/src/components/Comps/TTable.vue

+6-5
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166

167167
<script setup lang="ts">
168168
import {ref} from 'vue'
169-
import type {TableField, TableItem, BTable} from 'bootstrap-vue-next'
169+
import type {BTable, TableField, TableItem} from 'bootstrap-vue-next'
170170
171171
const stringTableDefinitions = ref(['last_name', 'first_name', 'age'])
172172
const objectTableDefinitions = ref<TableField[]>([
@@ -194,18 +194,19 @@ const items: TableItem[] = [
194194
const selection = ref<TableItem[]>([])
195195
const showSelectBox = ref(false)
196196
const selectionMode = ref<'single' | 'range' | 'multi'>('single')
197-
function selectClick(selected: TableItem[]) {
197+
const selectClick = (selected: TableItem[]) => {
198+
// eslint-disable-next-line no-console
198199
console.log(selected)
199200
selection.value = selected
200201
}
201202
202-
const currentTimeTable = ref<typeof BTable | null>(null);
203+
const currentTimeTable = ref<typeof BTable | null>(null)
203204
const currentTimeTableDefinitions: TableField[] = [
204205
{key: 'hours', label: 'Hours'},
205206
{key: 'minutes', label: 'Minutes'},
206207
{key: 'seconds', label: 'Seconds'},
207-
{key: 'milliseconds', label: 'Milliseconds'}
208-
];
208+
{key: 'milliseconds', label: 'Milliseconds'},
209+
]
209210
const currentTimeProvider = (): TableItem[] => {
210211
const now = new Date()
211212

packages/bootstrap-vue-next/src/components/BFormSpinbutton/BFormSpinbutton.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,8 @@ export default defineComponent({
335335
}
336336
}
337337
338-
function isMouseEvent(evt: Event): evt is MouseEvent {
339-
return evt.type === 'mouseup' || evt.type === 'mousedown'
340-
}
338+
const isMouseEvent = (evt: Event): evt is MouseEvent =>
339+
evt.type === 'mouseup' || evt.type === 'mousedown'
341340
// eslint-disable-next-line no-undef
342341
const onMouseup: EventListener = (event: Event) => {
343342
// `<body>` listener, only enabled when mousedown starts

packages/bootstrap-vue-next/src/composables/useModal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default (id: string | undefined = undefined) => {
3030
}
3131
}
3232

33-
function findBModal(component: ComponentInternalInstance): ComponentInternalInstance | null {
33+
const findBModal = (component: ComponentInternalInstance): ComponentInternalInstance | null => {
3434
if (!component.parent) {
3535
return null
3636
}

packages/bootstrap-vue-next/src/composables/useModalManager.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@ export const useSharedModalStack = createSharedComposable(() => {
1515
const stack: Ref<ComponentInternalInstance[]> = ref([])
1616
const count = computed(() => stack.value.length)
1717
const last = computed(() => stack.value[stack.value.length - 1])
18-
const push = (modal: ComponentInternalInstance) => {
19-
stack.value.push(modal)
20-
}
21-
const pop = () => {
22-
stack.value.pop()
23-
}
18+
const push = (modal: ComponentInternalInstance) => stack.value.push(modal)
19+
const pop = () => stack.value.pop()
2420
const remove = (modal: ComponentInternalInstance): void => {
2521
stack.value = stack.value.filter((item) => item.uid !== modal.uid)
2622
}

0 commit comments

Comments
 (0)