zj
2024-06-03 561ca040085b6fd6766e471a70b4a3c682deadc2
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
<template>
  <div id="normalHead">
    <van-nav-bar
        :border="false"
        :title="title"
        left-arrow
        @click-left="onClickLeft">
      <template #right>
        <slot></slot>
      </template>
    </van-nav-bar>
  </div>
</template>
 
<script>
export default {
  name: "normal-head",
  props: ['title', 'goHome', 'goAssetsCenter', 'goPerpetualContract', 'backFunc'],
  methods: {
    onClickLeft() {
      if (this.goHome) {
        this.$router.push('/');
      } else if (this.goAssetsCenter) {
        this.$router.push('/assetsCenter/assets');
      }else if (this.goPerpetualContract){
        this.$router.go(-2);
      } else if (this.backFunc) {
        this.backFunc()
      } else {
        this.$router.go(-1);
      }
    }
  }
}
</script>
 
<style scoped>
 
</style>