wms-antdvue/.svn/pristine/51/5170c1ee5469f68a4c736711cb1cd27bdbf6ead8.svn-base
2024-11-07 16:33:03 +08:00

84 lines
2.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<div class="n-layout-page-header">
<a-card :bordered="false" title="模态框">
模态框,用于向用户收集或展示信息,扩展 antd Modal 组件,比如拖拽,全屏等效果,
<br />
以下是 useModal
方式ref方式也支持使用方式和其他组件一致modalRef.value.closeModal()
</a-card>
</div>
<a-card :bordered="false" class="mt-4 proCard">
<a-alert message="Modal嵌套Form" type="info">
<template #description>
使用 useModal
进行弹窗展示和操作并演示了在Modal内和Form组件组合使用方法禁用点击蒙层关闭
</template>
</a-alert>
<a-divider />
<a-space>
<a-button type="primary" @click="openModal1">打开Modal嵌套Form例子</a-button>
</a-space>
<a-divider />
<a-alert message="内部方法演示" type="info">
<template #description>
使用 useModal 进行弹窗展示和操作,关闭弹窗,设置标题,更多用法,请参考文档
</template>
</a-alert>
<a-divider />
<a-space>
<a-button type="primary" @click="openModal2">打开演示</a-button>
</a-space>
<a-divider />
<a-alert message="提示" type="info">
<template #description>
组件暴露了setProps 方法,用于修改组件内部
Props比如标题具体参考UI框架文档请参考文档
</template>
</a-alert>
</a-card>
<Modal1 ref="modal1Ref" />
<Modal2 ref="modal2Ref" />
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import Modal1 from './Modal1.vue';
import Modal2 from './Modal2.vue';
const modal1Ref = ref(null);
const modal2Ref = ref(null);
function openModal1() {
modal1Ref.value.openModal();
}
function openModal2() {
modal2Ref.value.openModal();
}
</script>
<style lang="less">
.n-dialog.basicFormModal {
width: 640px;
}
.n-dialog.basicModalLight {
width: 410px;
}
</style>
<style lang="less" scoped>
.basicForm {
padding-top: 20px;
}
.n-dialog.basicModalLight {
width: 416px;
padding-top: 26px;
}
</style>