Dialog.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <div v-if="modelValue" class="dialog-wrap">
  3. <div class="dialog">
  4. <div class="dialog-header">
  5. <div class="gradient-text dialog-title">{{ title }}</div>
  6. <div class="icon-close" @click="closeDialog"></div>
  7. </div>
  8. <div class="dialog-content">
  9. <slot />
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script lang="ts" setup>
  15. interface Props {
  16. modelValue: boolean;
  17. title?: string;
  18. }
  19. const props = withDefaults(defineProps<Props>(), {
  20. modelValue: false
  21. });
  22. const emit = defineEmits(['update:modelValue', 'close']);
  23. // 关闭弹窗
  24. const closeDialog = () => {
  25. emit('update:modelValue', false);
  26. emit('close');
  27. };
  28. </script>
  29. <style lang="scss" scoped>
  30. .dialog-wrap {
  31. position: fixed;
  32. top: 50%;
  33. left: 50%;
  34. transform: translate(-50%, -50%);
  35. z-index: 2000;
  36. display: flex;
  37. align-items: center;
  38. justify-content: center;
  39. font-size: 16px;
  40. .dialog {
  41. width: 3399px;
  42. height: 1262px;
  43. margin: 0 auto;
  44. background: url('@/assets/images/map/rightMenu/dialog.png') no-repeat;
  45. color: #ffffff;
  46. padding-left: 70px;
  47. padding-right: 36px;
  48. }
  49. .dialog-header {
  50. width: 100%;
  51. height: 165px;
  52. position: relative;
  53. display: flex;
  54. align-items: center;
  55. position: relative;
  56. .dialog-title {
  57. font-size: 84px;
  58. }
  59. .icon-close {
  60. cursor: pointer;
  61. position: absolute;
  62. top: 0px;
  63. right: -33px;
  64. width: 64px;
  65. height: 60px;
  66. background: url('@/assets/images/map/rightMenu/close.png');
  67. }
  68. }
  69. .dialog-content {
  70. height: 1082px;
  71. overflow-y: auto;
  72. padding: 10px 0;
  73. }
  74. }
  75. </style>