Skip to content
Snippets Groups Projects

Ability to preview and upload logo and background images

Merged Eugenij requested to merge eugenijm/admin-fe:logo-and-background-upload into develop
@@ -13,6 +13,7 @@
{{ $t('settings.changeImage') }}
</div>
<el-image
v-loading="loading"
:src="imageUrl(inputValue)"
:style="dimensions"
class="uploaded-image"
@@ -64,6 +65,11 @@ export default {
}
}
},
data() {
return {
loading: false
}
},
computed: {
fullSize() {
if (this.setting.key === ':background') {
@@ -98,7 +104,9 @@ export default {
reader.onload = ({ target }) => {
const formData = new FormData()
formData.append('file', file)
this.loading = true
uploadMedia({ formData }).then(response => {
this.loading = false
this.$emit('change', { tuple: [':image_url', response.url] })
})
}
Loading