Make input file clip icon work

This commit is contained in:
William Buezas 2024-01-31 10:49:29 -03:00
parent b9dcbc18ca
commit 0e32138714
1 changed files with 13 additions and 4 deletions

View File

@ -74,7 +74,7 @@ const viewportTypes = [
const uploadMethodSelected = ref('computer');
const viewPortTypeSelected = ref(viewportTypes[0]);
const inputFileRef = ref(null);
const allowedContentTypes = ref('');
const photoContainerRef = ref(null);
const editor = ref(null);
@ -86,6 +86,10 @@ const newPhoto = reactive({
blob: null,
});
const openInputFile = () => {
inputFileRef.value.pickFiles();
};
const displayEditor = () => {
const viewportType = viewPortTypeSelected.value;
const viewport = viewportType.viewport;
@ -253,21 +257,26 @@ const makeRequest = async () => {
<div class="col">
<QFile
v-if="uploadMethodSelected === 'computer'"
ref="inputFileRef"
:label="t('File')"
:multiple="false"
v-model="newPhoto.files"
@update:model-value="updatePhotoPreview($event)"
:accept="allowedContentTypes"
class="required"
class="required cursor-pointer"
>
<template #append>
<QIcon
name="vn:attach"
class="cursor-pointer q-mr-sm"
class="cursor-pointer q-mr-sm non-selectable"
@click="openInputFile()"
>
<QTooltip>{{ t('Select a file') }}</QTooltip>
</QIcon>
<QIcon name="info" class="cursor-pointer">
<QIcon
name="info"
class="cursor-pointer non-selectable"
>
<QTooltip>{{
t(
'components.editPictureForm.allowedFilesText',