wip: data masih dead pixel upload sukses

This commit is contained in:
Khafid Prayoga
2025-10-15 16:37:46 +07:00
parent 4976916780
commit 20b96ab7e4
7 changed files with 86 additions and 27 deletions

No files matched your search

@@ -28,6 +28,13 @@ const hintMsg = computed(() => {
}
return 'Gunakan file yang sesuai'
})
async function onFileChange(event: Event, handleChange: (value: any) => void) {
const target = event.target as HTMLInputElement
const file = target.files?.[0]
handleChange(file)
}
</script>
<template>
@@ -44,20 +51,21 @@ const hintMsg = computed(() => {
:errors="errors"
>
<FormField
v-slot="{ componentField }"
v-slot="{ componentField, handleChange }"
:name="fieldName"
>
<FormItem>
<FormControl>
<Input
<FormControl class="flex flex-col">
<input
@change="onFileChange($event, handleChange)"
type="file"
:disabled="isDisabled"
v-bind="componentField"
:placeholder="placeholder"
:class="cn('focus:border-primary focus:ring-2 focus:ring-primary focus:ring-offset-0')"
/>
<span class="my-2 text-xs">{{ hintMsg }}</span>
</FormControl>
<span class="my-2 text-xs">{{ hintMsg }}</span>
<FormMessage />
</FormItem>
</FormField>