Updated code with changes

This commit is contained in:
Amisha Bagri 2025-02-03 20:16:50 +00:00
commit f89ef33218

View file

@ -1,4 +1,6 @@
<template> <template>
<div class = "text-center">
<v-menu v-model="menu" offset-y top nudge-top="6" :close-on-content-click="false"> <v-menu v-model="menu" offset-y top nudge-top="6" :close-on-content-click="false">
<template #activator="{ on, attrs }"> <template #activator="{ on, attrs }">
<v-btn color="accent" dark v-bind="attrs" v-on="on"> <v-btn color="accent" dark v-bind="attrs" v-on="on">
@ -35,6 +37,7 @@
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-menu> </v-menu>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -65,7 +68,7 @@ export default defineComponent({
function uploadImage(fileObject: File) { function uploadImage(fileObject: File) {
try{ try{
// Check if the file has an acceptable extension // Check if the file has an acceptable extension
const allowedExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp"]; const allowedExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp",".heic",".avif"];
const fileExtension = fileObject.name.split(".").pop()?.toLowerCase(); const fileExtension = fileObject.name.split(".").pop()?.toLowerCase();
// If the file extension is not in the allowed extensions list, show an error message // If the file extension is not in the allowed extensions list, show an error message