dialog.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <el-dialog
  3. :modal="modal"
  4. :title="title"
  5. :visible.sync="visible"
  6. :fullscreen="fullscreen"
  7. :key="reload"
  8. :before-close="handleCancel"
  9. :modal-append-to-body="false"
  10. :width="width"
  11. :show-close="false"
  12. :destroy-on-close="destroy"
  13. >
  14. <!-- 表格主体部分 -->
  15. <slot></slot>
  16. </el-dialog>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. visible: {
  22. type: Boolean,
  23. default: false,
  24. },
  25. title: {
  26. type: String,
  27. default: "",
  28. },
  29. reload: {
  30. type: Number,
  31. default: 0,
  32. },
  33. width: {
  34. type: String,
  35. default: "500px",
  36. },
  37. fullscreen: {
  38. type: Boolean,
  39. default: false,
  40. },
  41. modal: {
  42. type: Boolean,
  43. default: true,
  44. },
  45. destroy: {
  46. type: Boolean,
  47. default: false
  48. }
  49. },
  50. mounted() {
  51. },
  52. methods: {
  53. // 确定的回调
  54. handleConfirm() {
  55. this.$emit("confirm", false);
  56. },
  57. // 取消的回调
  58. handleCancel() {
  59. this.$emit("cancel", false);
  60. },
  61. },
  62. };
  63. </script>
  64. <style></style>