mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 15:13:30 +00:00
44 lines
1.5 KiB
Vue
44 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import SelectField from '../Field/SelectField.vue'
|
|
import FormButton from '../Field/FormButton.vue'
|
|
import type { FileShareHandleProps } from './types'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
const { t } = useI18n()
|
|
const props = defineProps<{
|
|
hide: () => void
|
|
file: File[]
|
|
onFileHandle: (props: FileShareHandleProps) => void
|
|
}>()
|
|
</script>
|
|
|
|
<template>
|
|
<VeeForm v-slot="{ values }" :initialValues="{ target_ext: 'jpg' }">
|
|
<div class="flex flex-col gap-3">
|
|
<h2 class="text-lg font-bold">{{ t('page.shareOptions.imageConvert.title') }}</h2>
|
|
<div class="flex flex-row gap-2 items-center">
|
|
<Label>{{ t('page.shareOptions.imageConvert.targetFormat') }}</Label>
|
|
<SelectField
|
|
name="target_ext"
|
|
:label="t('page.shareOptions.imageConvert.targetFormat')"
|
|
:options="[
|
|
{ label: 'JPG', value: 'jpg' },
|
|
{ label: 'PNG', value: 'png' },
|
|
{ label: 'WEBP', value: 'webp' },
|
|
]"
|
|
rules="required"
|
|
/>
|
|
</div>
|
|
<FormButton
|
|
@click="
|
|
async (form) => {
|
|
onFileHandle({ type: 'file-image-convert', config: values })
|
|
hide()
|
|
}
|
|
"
|
|
>{{ t('btn.submit') }}</FormButton
|
|
>
|
|
</div>
|
|
</VeeForm>
|
|
</template>
|