index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. },
  23. methods: {
  24. showModal() {
  25. this.visible = true;
  26. },
  27. closeModal() {
  28. this.visible = false;
  29. },
  30. },
  31. };
  32. </script>
  33. <template>
  34. <el-dialog
  35. :append-to-body="false"
  36. :modal-append-to-body="false"
  37. :visible.sync="visible"
  38. :top="top"
  39. :width="width"
  40. v-bind="$attrs"
  41. v-on="$listeners"
  42. >
  43. <slot />
  44. </el-dialog>
  45. </template>
  46. <style scoped lang="less">
  47. ::v-deep(.el-dialog) {
  48. background: none;
  49. color: #fff;
  50. .el-dialog__header {
  51. background-color: rgba(0, 102, 255, 0.26);
  52. color: #fff;
  53. height: 60px;
  54. box-sizing: border-box;
  55. border-top: 2px solid #00aaff;
  56. .el-dialog__title {
  57. color: #fff;
  58. }
  59. .el-dialog__title::before {
  60. content: "";
  61. display: inline-block;
  62. background: url("../assets/modal_header.svg") no-repeat center center;
  63. width: 9px;
  64. height: 14px;
  65. margin-right: 10px;
  66. }
  67. .el-dialog__headerbtn .el-dialog__close {
  68. color: #fff;
  69. }
  70. }
  71. .el-dialog__body {
  72. color: #fff;
  73. background-color: rgba(3, 18, 57, 0.78);
  74. }
  75. }
  76. </style>