index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div class="dialog">
  3. <el-dialog :model-value="props.flag" :append-to-body="props.isBody" ref="dialogTk" :top="props.top" :custom-class="props.customClass" :lock-scroll="false" :modal="props.modal" :before-close="props.close" :close-on-click-modal="false" :width="props.width" :show-close="props.showFlag">
  4. <div class="dialog-content">
  5. <slot />
  6. </div>
  7. </el-dialog>
  8. </div>
  9. </template>
  10. <script setup lang="ts">
  11. const props = defineProps({
  12. // 弹框开关
  13. flag: {
  14. type: Boolean,
  15. default: false,
  16. },
  17. showFlag: {
  18. type: Boolean,
  19. default: false,
  20. },
  21. // 弹框宽度
  22. width: {
  23. type: String,
  24. default: "400px",
  25. },
  26. // 弹框类名
  27. customClass: {
  28. type: String,
  29. default: "",
  30. },
  31. // 弹框高度
  32. top: {
  33. type: String,
  34. default: "0vh",
  35. },
  36. // 弹框遮罩层
  37. modal: {
  38. type: Boolean,
  39. default: true,
  40. },
  41. // 二级弹框标记
  42. child: {
  43. type: Boolean,
  44. default: false,
  45. },
  46. isBody: {
  47. type: Boolean,
  48. default: true,
  49. },
  50. });
  51. const emits = defineEmits(["closeDialog"]);
  52. const close = () => {
  53. emits("closeDialog");
  54. };
  55. </script>