-
-
Save uno-de-piera/d83e4f8053260bc8c81c60e8f1d9b0cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<form> | |
<v-layout row wrap> | |
<v-flex xs12 mt-3> | |
<v-image-input | |
v-model="image" | |
:image-quality="0.85" | |
clearable | |
image-format="png" | |
:full-width="true" | |
minScaling="contain" | |
:image-width="520" | |
></v-image-input> | |
</v-flex> | |
</v-layout> | |
<v-layout row wrap justify-end> | |
<v-flex xs12 lg3 md4 shrink pl-1 pr-1> | |
<v-btn | |
:text="$t('uploadFile')" | |
icon="save" | |
@click="submit" | |
/> | |
</v-flex> | |
</v-layout> | |
</form> | |
</template> | |
<script> | |
import VImageInput from "vuetify-image-input"; | |
import S3Utils from "@/classes/S3Utils"; | |
export default { | |
name: "UploadForm", | |
components: { | |
VImageInput | |
}, | |
data() { | |
return { | |
image: null | |
}; | |
}, | |
methods: { | |
async submit() { | |
this.$v.$touch(); | |
if (this.$v.$anyError) return; | |
await S3Utils.uploadImage(this.image, "photos"); | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment