Skip to content

Commit

Permalink
style(VFileUpload): fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Apr 27, 2024
1 parent 0510ede commit 72e0824
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions packages/vuetify/src/labs/VFileUpload/VFileUpload.tsx
Expand Up @@ -24,6 +24,13 @@ import { genericComponent, humanReadableFileSize, only, propsFactory, useRender,
// Types
import type { PropType } from 'vue'

export type VFileUploadSlots = {
default: never
icon: never
title: never
divider: never
}

export const makeVFileUploadProps = propsFactory({
browseText: {
type: String,
Expand Down Expand Up @@ -60,7 +67,7 @@ export const makeVFileUploadProps = propsFactory({
...makeVSheetProps(),
}, 'VFileUpload')

export const VFileUpload = genericComponent()({
export const VFileUpload = genericComponent<VFileUploadSlots>()({
name: 'VFileUpload',

props: makeVFileUploadProps(),
Expand Down Expand Up @@ -123,7 +130,10 @@ export const VFileUpload = genericComponent()({

for (const file of files) {
if (!model.value.some(f => f.name === file.name)) {
model.value.push(file)
model.value = [
...model.value,
file,
]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/labs/VFileUpload/VFileUploadItem.tsx
Expand Up @@ -10,7 +10,6 @@ import { genericComponent, propsFactory, useRender } from '@/util'
import type { VListItemSlots } from '@/components/VList/VListItem'

export const makeVFileUploadItemProps = propsFactory({

...makeVListItemProps({
border: true,
rounded: true,
Expand All @@ -26,6 +25,7 @@ export const VFileUploadItem = genericComponent<VListItemSlots>()({

emits: {
'click:remove': () => true,
click: (e: MouseEvent | KeyboardEvent) => true,
},

setup (props, { emit, slots }) {
Expand Down

0 comments on commit 72e0824

Please sign in to comment.