smart-power-ui/src/components/DialogTemplate/index.vue

84 lines
1.5 KiB
Vue

<template>
<div class="dialog-bit">
<el-dialog :close-on-click-modal="false" :title="title" :visible="visible" :width="width" append-to-body class="eldialog-wrap-t" @close="close">
<slot name="dialog-center"></slot>
<div slot="footer" class="dialog-footer">
<slot name="dialog-footer"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'dialogTemplate',
props: {
title: {
type: String
},
visible: {
type: Boolean,
default: false
},
width: {
type: String,
default() {
return '450px'
}
}
},
methods: {
close() {
this.$emit('close')
}
},
}
</script>
<style lang="scss" >
.dialog-bit {
.eldialog-wrap-t {
.el-dialog__header {
}
.el-dialog__body {
padding: 10px;
}
.el-dialog__footer {
height: 60px;
text-align: right;
width: 100%;
padding: 0px;
padding-top: 15px;
.el-button + .el-button {
margin-right: 10px;
}
.el-button {
padding-top: 8px;
}
}
}
}
.eldialog-wrap-t {
.el-dialog__header {
}
.el-dialog__body {
padding: 10px;
}
.el-dialog__footer {
height: 60px;
text-align: right;
width: 100%;
padding: 0px;
padding-top: 15px;
.el-button + .el-button {
margin-right: 10px;
}
.el-button {
padding-top: 8px;
}
}
}
</style>