Blame view

ant-design-vue-jeecg/src/views/result/Result.vue 1.57 KB
肖超群 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<template>
  <div class="result">
    <div>
      <a-icon :class="[isSuccess ? 'success' : 'error' ,'icon']" :type="isSuccess ? 'check-circle' : 'close-circle'"/>
    </div>
    <div class="title" v-if="title">{{ title }}</div>
    <div class="description" v-if="description">{{ description }}</div>
    <div class="content" v-if="content">
      <slot></slot>
    </div>
    <div class="action">
      <slot name="action"></slot>
    </div>
  </div>
</template>

<script>
肖超群 authored
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export default {
  name: "Result",
  // 'isSuccess', 'title', 'description'
  props: {
    isSuccess: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ''
    },
    description: {
      type: String,
      default: ''
    },
    content: {
      type: Boolean,
      default: true
肖超群 authored
37
38
    }
  }
肖超群 authored
39
}
肖超群 authored
40
41
42
</script>

<style lang="less" scoped>
肖超群 authored
43
44
45
46
47
.result {
  text-align: center;
  width: 72%;
  margin: 0 auto;
  padding: 24px 0 8px;
肖超群 authored
48
肖超群 authored
49
50
51
52
  .icon {
    font-size: 72px;
    line-height: 72px;
    margin-bottom: 24px;
肖超群 authored
53
54
  }
肖超群 authored
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
  .success {
    color: #52c41a;
  }

  .error {
    color: red;
  }

  .title {
    font-size: 24px;
    color: rgba(0, 0, 0, .85);
    font-weight: 500;
    line-height: 32px;
    margin-bottom: 16px;
  }

  .description {
    font-size: 14px;
    line-height: 22px;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 24px;
  }

  .content {
    background: #fafafa;
    padding: 24px 40px;
    border-radius: 2px;
    text-align: left;
  }

  .action {
    margin-top: 32px;
  }
}

.mobile {
  .result {
    width: 100%;
    margin: 0 auto;
    padding: unset;
肖超群 authored
95
  }
肖超群 authored
96
}
肖超群 authored
97
</style>