Commit 7839bba1 authored by 赵啸非's avatar 赵啸非

添加附件显示

parent e0bf4d38
......@@ -28,8 +28,12 @@
<el-divider style="width: 100%"></el-divider>
<div v-if="isImage">
<img :src="form.filePath" alt="图片描述">
</div>
<div v-else>
<el-link type="primary" :href="form.filePath" >{{form.fileName}}</el-link>
</div>
</el-card>
</el-col>
</el-row>
......@@ -44,10 +48,21 @@
components: {
},
methods: {
afterRender(data) {
this.checkFileType()
},
checkFileType() {
const extension = this.form.fileName.split('.').pop().toLowerCase();
if (['jpg', 'jpeg', 'png', 'gif'].indexOf(extension) !== -1) {
this.isImage = true;
} else {
this.isImage = false;
}
},
},
data() {
return {
isImage: false,
size:"small",
column:2,
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