1
0

index.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <script>
  2. import { Dialog as ElDialog } from "element-ui";
  3. export default {
  4. name: "BasicModal",
  5. components: {
  6. ElDialog,
  7. },
  8. data() {
  9. return {
  10. visible: false,
  11. };
  12. },
  13. props: {
  14. top: {
  15. type: String,
  16. default: "184px",
  17. },
  18. width: {
  19. type: String,
  20. default: "1456px",
  21. },
  22. appendToBody: {
  23. type: Boolean,
  24. default: false,
  25. },
  26. },
  27. methods: {
  28. showModal() {
  29. this.visible = true;
  30. },
  31. closeModal() {
  32. this.visible = false;
  33. },
  34. },
  35. };
  36. </script>
  37. <template>
  38. <el-dialog
  39. :append-to-body="this.appendToBody"
  40. :modal-append-to-body="false"
  41. :visible.sync="visible"
  42. :top="top"
  43. :width="width"
  44. v-bind="$attrs"
  45. v-on="$listeners"
  46. >
  47. <slot />
  48. </el-dialog>
  49. </template>
  50. <style scoped lang="less">
  51. ::v-deep(.el-dialog) {
  52. background: none;
  53. color: #fff;
  54. .el-dialog__header {
  55. background-color: rgba(0, 102, 255, 0.26);
  56. color: #fff;
  57. height: 60px;
  58. box-sizing: border-box;
  59. border-top: 2px solid #00aaff;
  60. .el-dialog__title {
  61. color: #fff;
  62. }
  63. .el-dialog__title::before {
  64. content: "";
  65. display: inline-block;
  66. background: url("../assets/modal_header.svg") no-repeat center center;
  67. width: 9px;
  68. height: 14px;
  69. margin-right: 10px;
  70. }
  71. .el-dialog__headerbtn .el-dialog__close {
  72. color: #fff;
  73. }
  74. }
  75. .el-dialog__body {
  76. color: #fff;
  77. background-color: rgba(3, 18, 57, 0.78);
  78. }
  79. }
  80. </style>