Commit a42bcdbf authored by 赵啸非's avatar 赵啸非

修改部门新增

parent e12953c8
...@@ -31,6 +31,13 @@ ...@@ -31,6 +31,13 @@
<div v-if="isImage"> <div v-if="isImage">
<img :src="form.filePath" alt="图片描述"> <img :src="form.filePath" alt="图片描述">
</div> </div>
<div v-else-if="isVideo">
<video id="myVideo" controls>
<source :src="form.filePath" type="video/mp4">
</video>
</div>
<div v-else> <div v-else>
<el-link type="primary" :href="form.filePath" >{{form.fileName}}</el-link> <el-link type="primary" :href="form.filePath" >{{form.fileName}}</el-link>
</div> </div>
...@@ -55,7 +62,10 @@ ...@@ -55,7 +62,10 @@
const extension = this.form.fileName.split('.').pop().toLowerCase(); const extension = this.form.fileName.split('.').pop().toLowerCase();
if (['jpg', 'jpeg', 'png', 'gif'].indexOf(extension) !== -1) { if (['jpg', 'jpeg', 'png', 'gif'].indexOf(extension) !== -1) {
this.isImage = true; this.isImage = true;
} else { }else if (['mp4'].indexOf(extension) !== -1) {
this.isVideo=true
}
else {
this.isImage = false; this.isImage = false;
} }
}, },
...@@ -63,6 +73,7 @@ ...@@ -63,6 +73,7 @@
data() { data() {
return { return {
isImage: false, isImage: false,
isVideo: false,
size:"small", size:"small",
column:2, column:2,
toString:[ toString:[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment