add thumbnail for SVG

This commit is contained in:
Simon Vieille 2021-06-22 11:37:39 +02:00
parent 43d46a442d
commit 26f68a659a
1 changed files with 8 additions and 0 deletions

View File

@ -6,6 +6,9 @@
</template>
<style scoped>
img {
max-width: 120px;
}
</style>
<script>
@ -45,6 +48,11 @@ export default {
this.icon = 'fa fa-file'
},
defineThumbnail () {
if (['image/svg', 'image/svg+xml'].indexOf(this.mime) !== -1) {
this.thumbnail = '/' + this.path
return
}
if (['image/png', 'image/jpg', 'image/jpeg', 'image/gif'].indexOf(this.mime) === -1) {
return
}