c-dialog.vue 830 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <div id="e-dialog">
  3. <el-dialog :title="dialog.title" v-model="dialog.show" :width="width" :before-close="handleClose" :close-on-click-modal="false" :append-to-body="true">
  4. <el-col :span="24" class="dialogInfo" :style="{ 'max-height': height }"><slot name="info"></slot></el-col>
  5. </el-dialog>
  6. </div>
  7. </template>
  8. <script lang="ts" setup>
  9. import { toRefs } from 'vue';
  10. const props = defineProps({
  11. dialog: { type: Object, default: () => {} },
  12. width: { type: String, default: '40%' },
  13. height: { type: String, default: '400px' }
  14. });
  15. const { dialog } = toRefs(props);
  16. const { width } = toRefs(props);
  17. const emit = defineEmits(['handleClose']);
  18. const handleClose = () => {
  19. emit('handleClose');
  20. };
  21. </script>
  22. <style lang="scss" scoped>
  23. .dialogInfo {
  24. min-height: 30px;
  25. overflow-y: auto;
  26. }
  27. </style>