goback.vue
752 Bytes
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
<template>
<view class="back" @click="goback" v-if="!$isMobile">
<u-image src="/static/images/icon/back.png" mode="witFix" width="100px" height="100px"></u-image>
</view>
</template>
<script>
export default {
components: {},
props: {
},
data() {
return {
}
},
computed: {
},
onLoad() {
},
methods: {
goback() {
if (window.history.length > 1) {
window.history.back();
} else {
window.location.href = '/mobile';
}
}
}
}
</script>
<style lang="scss" scoped>
.back {
width: 50px;
height: 50px;
border-radius: 50px;
position: fixed;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left:1%;
top: 10%;
bottom: 0;
}
</style>