import{o as a,c as n,a as t}from"./app.c38d1953.js";const s='{"title":"Dialog 弹窗组件","description":"","frontmatter":{},"headers":[{"level":2,"title":"用法","slug":"用法"},{"level":2,"title":"Dialog 属性","slug":"dialog-属性"},{"level":2,"title":"Dialog 插槽","slug":"dialog-插槽"}],"relativePath":"components/dialog.md","lastUpdated":1721206001124}',p={},o=t('
对 element-plus
的 Dialog
组件进行封装。
Dialog 组件位于 src/components/Dialog 内
<script setup lang="ts">\nimport { Dialog } from '@/components/Dialog'\nimport { ElButton } from 'element-plus'\nimport { ref } from 'vue'\n\nconst dialogVisible = ref(false)\n</script>\n\n<template>\n <ElButton type="primary" @click="dialogVisible = !dialogVisible">\n open\n </ElButton>\n <Dialog v-model="dialogVisible" title="dialog">\n <div v-for="v in 10000" :key="v">{{ v }}</div>\n <template #footer>\n <el-button @click="dialogVisible = false">close</el-button>\n </template>\n </Dialog>\n</template>\n\n
除以下参数外,还支持 element-plus
的 Dialog
所有属性,详见
属性 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
modelValue | 是否显示弹窗,支持v-model | boolean | - | false |
fullscreen | 是否显示全屏按钮 | boolean | - | true |
title | 弹窗标题 | string | - | Dialog |
maxHeight | 弹窗内容最大高度 | string /number | - | 500px |
插槽名 | 说明 | 子标签 |
---|---|---|
- | 弹窗内容 | - |
title | 弹窗标题内容 | - |
footer | 弹窗底部内容 | - |