弹框样式修改

This commit is contained in:
zhujiyan
2024-08-28 15:39:08 +08:00
parent f148f9a089
commit ed0a7efd51
7 changed files with 385 additions and 16 deletions

View File

@@ -0,0 +1,41 @@
<!-- 全局封装dialog组件 -->
<template>
<el-dialog
v-model="dialogVisible"
:title="dialogTitle"
width="50%"
:before-close="handleClose"
:draggable="true"
:destroy-on-close="true"
:append-to-body="true"
>
<div class="container">
<slot name="container"></slot>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="dialogVisible = false">
确定
</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref, onMounted, defineExpose } from "vue";
const dialogVisible = ref<Boolean>(false);
const dialogTitle = ref<string>("");
const openDialog = (title: string) => {
dialogTitle.value = title;
console.log(dialogVisible.value);
dialogVisible.value = true;
};
defineExpose({
openDialog,
});
onMounted(() => {
console.log();
});
</script>
<style lang="scss" scoped></style>