add thumbnail for SVG

This commit is contained in:
Simon Vieille 2021-06-22 11:37:39 +02:00
parent 43d46a442d
commit 26f68a659a

View file

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