46dd5412f3e27c17a7bcd99c277fba9dfd9a815a.svn-base 1.7 KB

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