mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-30 00:55:20 +01:00
refs #323 Show image as a picture if the extension is unknown in Media
This commit is contained in:
parent
adf6c83d61
commit
9b5e92b23e
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<img :src="src" v-if="isImageFile()">
|
||||
<video :src="src" v-else-if="isMovieFile()" controls></video>
|
||||
<video :src="src" v-if="isMovieFile()" controls></video>
|
||||
<img :src="src" v-else>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -12,9 +12,6 @@ export default {
|
||||
file_ext () {
|
||||
return this.src.split('.').pop().toLowerCase()
|
||||
},
|
||||
isImageFile () {
|
||||
return ['jpg', 'gif', 'png'].indexOf(this.file_ext()) >= 0
|
||||
},
|
||||
isMovieFile () {
|
||||
return ['mp4'].indexOf(this.file_ext()) >= 0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user