message-box.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div class="msg-box-overlay" v-if="dialogVisible">
  3. <div class="content-wrapper">
  4. <div class="title">{{title}}</div>
  5. <div class="desc">{{content}}</div>
  6. <div class="btn-wrapper">
  7. <div class="btn cancel" @click="cancel">Cancel</div>
  8. <div class="btn confirm" @click="confirm">Confirm</div>
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script setup>
  14. /* eslint-disable */
  15. import { ref, defineEmits, defineProps } from "vue";
  16. const props = defineProps({
  17. dialogVisible: {
  18. type: Boolean,
  19. default: false,
  20. },
  21. title: {
  22. type: String,
  23. default: ''
  24. },
  25. content: {
  26. type: String,
  27. default: ''
  28. },
  29. });
  30. const emits = defineEmits(["cancel", "confirm"]);
  31. const cancel = () => {
  32. emits("cancel", {});
  33. };
  34. const confirm = () => {
  35. emits("confirm", {});
  36. };
  37. </script>
  38. <style lang="scss" scoped>
  39. .msg-box-overlay {
  40. position: fixed;
  41. top: 0;
  42. right: 0;
  43. bottom: 0;
  44. left: 0;
  45. z-index: 1000;
  46. height: 100%;
  47. background-color: rgba(0, 0, 0, 0.5);
  48. overflow: auto;
  49. .content-wrapper {
  50. position: absolute;
  51. left: 50%;
  52. top: 50%;
  53. width: 375px;
  54. height: 220px;
  55. background: #FFFFFF;
  56. border-radius: 20px;
  57. padding: 20px;
  58. box-sizing: border-box;
  59. transform: translate(-50%, -50%);
  60. text-align: center;
  61. .title {
  62. font-weight: 600;
  63. font-size: 20px;
  64. margin-bottom: 13px;
  65. }
  66. .desc {
  67. height: 68px;
  68. font-weight: 400;
  69. font-size: 15px;
  70. margin-bottom: 25px;
  71. }
  72. .btn-wrapper {
  73. display: flex;
  74. align-items: center;
  75. justify-content: space-between;
  76. .btn {
  77. height: 46px;
  78. width: 163px;
  79. text-align: center;
  80. line-height: 46px;
  81. border-radius: 100px;
  82. border: 1px solid #389AFF;
  83. box-sizing: border-box;
  84. font-weight: 600;
  85. font-size: 16px;
  86. cursor: pointer;
  87. }
  88. .cancel {
  89. color: #389AFF;
  90. }
  91. .confirm {
  92. background: #389AFF;
  93. color: #fff;
  94. }
  95. }
  96. }
  97. }
  98. </style>