Blame view

src/components/backBox.vue 1.21 KB
d4283687   梁保满   首页布局完成,页面顶部返回组件
1
2
3
  <template>
    <div class="back">
      <div class="back-l" @click="back">
65f592b6   梁保满   答题卡列表页
4
        <i class="fa fa-mail-reply-all"></i>
d4283687   梁保满   首页布局完成,页面顶部返回组件
5
6
7
8
9
10
11
12
13
        <slot name="title"></slot>
      </div>
      <div class="back-r">
        <slot name="btns"></slot>
      </div>
    </div>
  </template>
  
  <script>
d4283687   梁保满   首页布局完成,页面顶部返回组件
14
15
  export default {
    name: "back",
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
16
17
18
19
    props: {
      params: {
        type: Object,
        default: function () {
813d4d64   梁保满   批量设置答案添加输入
20
21
          return {}
        }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
22
23
24
25
26
      },
      toHome: {
        type: Boolean,
        default: false
      },
813d4d64   梁保满   批量设置答案添加输入
27
    },
d4283687   梁保满   首页布局完成,页面顶部返回组件
28
29
    methods: {
      back() {
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
30
31
32
33
34
35
36
        console.log(this.toHome)
        if (this.toHome) {
          this.$router.push({
            path: "/index",
          })
          return
        }
d4283687   梁保满   首页布局完成,页面顶部返回组件
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
        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;
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
53
  
d4283687   梁保满   首页布局完成,页面顶部返回组件
54
55
56
57
58
59
60
61
    .back-l {
      display: flex;
      align-items: center;
      cursor: pointer;
      flex-shrink: 0;
      font-size: 18px;
      font-weight: 500;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
62
  
d4283687   梁保满   首页布局完成,页面顶部返回组件
63
64
65
66
67
    .back-r {
      flex: 1;
      display: flex;
      justify-content: flex-end;
    }
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
68
  
d4283687   梁保满   首页布局完成,页面顶部返回组件
69
70
71
72
73
74
75
    .fa-mail-reply-all {
      font-size: 28px;
      color: #b3b3b3;
      margin-right: 12px;
    }
  }
  </style>