齐采药WEB端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

171 lines
3.4 KiB

:before-close="handleClose"<!-- 功能弹框 -->
<template>
<div class="">
<el-dialog
:visible="dialogSlotShow"
:width="width"
@update:dialogSlotShow="updateVisible"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<div slot="title" style="display: flex" v-if="titleShow">
<div class="tipsTexe">
{{ tipsText }}
</div>
</div>
<div>
<slot name="contentSlot"></slot>
</div>
<span slot="footer" class="dialog-footer">
<div>
<slot name="seleSlot"></slot>
</div>
<div>
<el-button
v-if="cancleBtnShow"
size="small"
type="info"
@click="clickCancel"
>{{ cancelText }}</el-button
>
<el-button
v-if="confirmBtnShow"
size="small"
type="primary"
@click="clickConfirm"
>{{ confirmText }}</el-button
>
</div>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
//import引入的组件需要注入到对象中才能使用
components: {},
props: {
// 提示标题文字
tipsText: {
type: String,
default: () => "提示",
},
// 取消按钮文字
cancelText: {
type: String,
default: () => "取消",
},
// 确认按钮文字
confirmText: {
type: String,
default: () => "确认",
},
// 是否显示取消按钮
cancleBtnShow: {
type: Boolean,
default: () => true,
},
// 是否显示确认按钮
confirmBtnShow: {
type: Boolean,
default: () => true,
},
// 是否显示标题
titleShow: {
type: Boolean,
default: () => true,
},
// 是否显示弹框
dialogSlotShow: {
type: Boolean,
default: () => false,
},
// 弹框宽度
width:{
type: String,
default: () => '30%',
}
},
data() {
//这里存放数据
return {
// dialogShow: true,
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//生命周期 - 创建完成(可以访问当前this实例)
created() {},
//方法集合
methods: {
/* 更新visible */
updateVisible(value) {
this.$emit("update:dialogSlotShow", value);
},
// 确认
clickConfirm() {
this.$emit("clickConfirm");
},
// 取消
clickCancel() {
this.updateVisible(false);
this.$emit("clickCancel");
},
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
};
</script>
<style lang="scss" scoped>
::v-deep {
.el-input__inner {
height: 32px;
line-height: 32px;
}
.el-form-item__content {
line-height: 32px;
}
.el-form-item__label {
line-height: 32px;
}
.el-form-item__label {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #000;
}
}
::v-deep {
.el-dialog__body {
padding: 0 20px;
}
.el-dialog {
border-radius: 4px;
}
.el-button--info {
background: #f6f6f6;
border-color: #f6f6f6;
color: #999;
}
.el-dialog__footer {
padding: 10px 30px 20px 20px;
}
}
.tipsTexe {
height: 24px;
line-height: 24px;
font-size: 16px;
font-weight: 500;
}
.dialog-footer{
display: flex;justify-content: space-between;
}
</style>