wip: data masih dead pixel upload sukses
This commit is contained in:
No files matched your search
+12
-4
@@ -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>
|
||||
Reference in New Issue
Block a user