picDialog.vue
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
<!-- 查看大图 -->
<div class="view_picture">
<el-dialog
:visible="picVisible"
@update:visible="$emit('update:picVisible',false)"
:close-on-click-modal="false"
:before-close="handleClose"
title="查看大图"
append-to-body
center
>
<div class="pic_box">
<img :src="viwImg" alt />
</div>
</el-dialog>
</div>
</template>
<script>
import {post} from "@/api/http";
export default {
props: ["picVisible", "id"],
data() {
return {
viwImg: ""
};
},
methods: {
handleClose: function() {
localStorage.removeItem("viewPic");
this.$emit("update:picVisible", false);
},
// 职业详情
getProfessionDetail() {
let url = "/api/profession/getProfessionDetail/";
let params = {
id: this.id
};
post(url, params).then(res => {
this.viwImg = res.profession.thumb
});
},
},
mounted() {
this.getProfessionDetail();
}
};
</script>
<style scoped>
.pic_box {
margin: 0 auto;
margin: 25px 0;
}
.pic_box img{
width:100%;
}
</style>