|
@@ -0,0 +1,32 @@
|
|
|
+<script setup lang="ts">
|
|
|
+import { ref, withDefaults } from 'vue'
|
|
|
+
|
|
|
+interface Props {
|
|
|
+ title: string
|
|
|
+ width?: string | number
|
|
|
+}
|
|
|
+
|
|
|
+const props = withDefaults(defineProps<Props>(), {
|
|
|
+ title: '',
|
|
|
+ width: 800
|
|
|
+})
|
|
|
+const { title, width } = toRefs(props)
|
|
|
+const { beforeClose } = reactive(props)
|
|
|
+const dialogVisible = ref(false)
|
|
|
+const handleOpen = () => {
|
|
|
+ console.log('handleOpen')
|
|
|
+ dialogVisible.value = true
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="modal-open-btn" @click="handleOpen">
|
|
|
+ <slot name="btn"></slot>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog v-model="dialogVisible" :title="title" :width="width">
|
|
|
+ <slot name="content"></slot>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped lang="scss"></style>
|