backBox.vue
1.21 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<template>
<div class="back">
<div class="back-l" @click="back">
<i class="fa fa-mail-reply-all"></i>
<slot name="title"></slot>
</div>
<div class="back-r">
<slot name="btns"></slot>
</div>
</div>
</template>
<script>
export default {
name: "back",
props: {
params: {
type: Object,
default: function () {
return {}
}
},
toHome: {
type: Boolean,
default: false
},
},
methods: {
back() {
console.log(this.toHome)
if (this.toHome) {
this.$router.push({
path: "/index",
})
return
}
this.$router.go(-1);
},
},
};
</script>
<style lang="scss" scoped>
.back {
width: 100%;
height: 56px;
border-bottom: 1px solid #e2e2e2;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
box-sizing: border-box;
.back-l {
display: flex;
align-items: center;
cursor: pointer;
flex-shrink: 0;
font-size: 18px;
font-weight: 500;
}
.back-r {
flex: 1;
display: flex;
justify-content: flex-end;
}
.fa-mail-reply-all {
font-size: 28px;
color: #b3b3b3;
margin-right: 12px;
}
}
</style>