Skip to content

功能

el-dialog 的修改版,右上角增加最大化,样式调整。

懒渲染模式(未开启时不渲染,打开时渲染,关闭时销毁),常用于循环数据的默认隐藏

flex 模式方便 slot 的内容实现高度撑满父容器(100%高,slot节点的 flex-grow 为 1)

功能示例

展示区
参数:内容高
参数:最大内容高
参数:全屏
参数:默认全屏
参数:默认 footer

最小示例

vue
<template>
    <Wrapper>
        <HDialog v-model="visible" title="测试">
            内容
        </HDialog>
        <HButton @click="() => toggleVisible()">打开</HButton>
    </Wrapper>
</template>

<script lang="ts" setup>
import { useToggle } from '@vueuse/core'
import Wrapper from '@/components/simple-wrapper.vue'
import HDialog from '../index.vue'

const [visible, toggleVisible] = useToggle()
</script>

API