NavBar.vue
1004 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
51
<!-- components navbar-->
<template>
<div class="com-navbar-container">
<van-nav-bar :title="meta.title" :left-text="leftText" :right-text="rightText" :left-arrow="!meta.isNoBack" @click-left="onClickLeft" @click-right="onClickRight" v-show="meta.title != 'login'" />
<slot></slot>
</div>
</template>
<script>
export default {
name: 'NavBar',
props: {
meta: Object,
leftText: {
type: String,
default: ''
},
rightText: {
type: String,
default: ''
}
},
data() {
return {}
},
computed: {},
mounted() {},
methods: {
onClickLeft() {
// if (this.meta.auth) {
// window.location.href = document.referrer
// window.history.back(-1)
// } else {
this.$router.go(-1)
// }
},
onClickRight() {}
}
}
</script>
<style lang="scss" scoped>
.com-navbar-container {
/deep/.van-nav-bar {
&__arrow {
@include font(20px, 500, #323233);
margin-right: 4px;
}
}
}
</style>