123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <script>
- import { Dialog as ElDialog } from "element-ui";
- export default {
- name: "BasicModal",
- components: {
- ElDialog,
- },
- data() {
- return {
- visible: false,
- };
- },
- props: {
- top: {
- type: String,
- default: "184px",
- },
- width: {
- type: String,
- default: "1456px",
- },
- name: {
- type: String,
- default: "",
- },
- appendToBody: {
- type: Boolean,
- default: false,
- },
- },
- methods: {
- showModal() {
- this.visible = true;
- },
- closeModal() {
- this.visible = false;
- },
- slotTitle() {
- console.log(this.$slots)
- return "111"
- }
- },
- };
- </script>
- <template>
- <el-dialog
- :append-to-body="this.appendToBody"
- :modal-append-to-body="false"
- :visible.sync="visible"
- :top="top"
- :width="width"
- v-bind="$attrs"
- v-on="$listeners"
- :title="name"
- >
- <slot />
- <span slot="title" v-if="name===''" >
- <slot name="title" ></slot>
- </span>
- </el-dialog>
- </template>
- <style scoped lang="less">
- ::v-deep(.el-dialog) {
- background: none;
- color: #fff;
- margin-bottom: 0px;
- .el-dialog__header {
- background-color: #012669ee;
- color: #fff;
- height: 60px;
- box-sizing: border-box;
- border-top: 2px solid #00aaff;
- .el-dialog__title {
- color: #fff;
- }
- .el-dialog__title::before {
- content: "";
- display: inline-block;
- background: url("../assets/modal_header.svg") no-repeat center center;
- width: 9px;
- height: 14px;
- margin-right: 10px;
- }
- .el-dialog__headerbtn .el-dialog__close {
- color: #fff;
- }
- }
- .el-dialog__header .el-dialog__headerbtn .el-dialog__close {
- background-color: rgba(255, 0, 0, .4);
- padding: 4px;
- }
- .el-dialog__body {
- color: #fff;
- background-color: rgba(3, 18, 57, 0.9);
- }
- }
- </style>
|