Result.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div class="result">
  3. <div>
  4. <a-icon :class="{ 'icon': true, 'success': isSuccess, 'error': !isSuccess }" :type="isSuccess ? 'check-circle' : 'close-circle'"/>
  5. </div>
  6. <div class="title" v-if="title">{{ title }}</div>
  7. <div class="description" v-if="description">{{ description }}</div>
  8. <div class="content" v-if="content">
  9. <slot></slot>
  10. </div>
  11. <div class="action">
  12. <slot name="action"></slot>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'Result',
  19. props: {
  20. isSuccess: {
  21. type: Boolean,
  22. default: false
  23. },
  24. title: {
  25. type: String,
  26. default: ''
  27. },
  28. description: {
  29. type: String,
  30. default: ''
  31. },
  32. content: {
  33. type: Boolean,
  34. default: true
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .result {
  41. text-align: center;
  42. width: 72%;
  43. margin: 0 auto;
  44. padding: 24px 0 8px;
  45. .icon {
  46. font-size: 72px;
  47. line-height: 72px;
  48. margin-bottom: 24px;
  49. }
  50. .success {
  51. color: #52c41a;
  52. }
  53. .error {
  54. color: red;
  55. }
  56. .title {
  57. font-size: 24px;
  58. color: rgba(0, 0, 0, .85);
  59. font-weight: 500;
  60. line-height: 32px;
  61. margin-bottom: 16px;
  62. }
  63. .description {
  64. font-size: 14px;
  65. line-height: 22px;
  66. color: rgba(0, 0, 0, 0.45);
  67. margin-bottom: 24px;
  68. }
  69. .content {
  70. background: #fafafa;
  71. padding: 24px 40px;
  72. border-radius: 2px;
  73. text-align: left;
  74. }
  75. .action {
  76. margin-top: 32px;
  77. }
  78. }
  79. .mobile {
  80. .result {
  81. width: 100%;
  82. margin: 0 auto;
  83. padding: unset;
  84. }
  85. }
  86. </style>