首页 > 教程
Ant Design Vue 4.0 a-modal弹窗组件封装
- 2025-04-07
- 1139 ℃
父组件(部分)
<template>
<div>
<a-button
type="primary"
ghost
@click="dialogPanelStatus.signIngInfoStatus = true"
>签约信息</a-button
>
</div>
<!-- 签约信息 -->
<SigningInfo
:signIngInfoStatus="dialogPanelStatus.signIngInfoStatus"
:walletData="walletData"
@closeDialog="closeDialog"
/>
</template>
<script setup>
import SigningInfo from "@/components/Income/SigningInfo.vue";
// DIalog弹窗状态
const dialogPanelStatus = reactive<DialogPanelStatus>({
signIngInfoStatus: false,
});
// 数据重载
const getMyWalletFn = () => {
// 数据重载
};
// 关闭弹窗
const closeDialog = (k: keyof DialogPanelStatus, rest: boolean) => {
dialogPanelStatus[k] = false;
rest && getMyWalletFn(true);
};
</script>
<style scoped>
@import "Income.less";
</style>弹窗子组件
<template>
<a-modal
:open="visible"
title="弹框"
:footer="null"
destroyOnClose
:maskClosable="false"
@cancel="closeDialogFn(false)"
>
<div>
<a-card size="small" hoverable>
<p>真实姓名:{{ walletData.real_name }}</p>
</a-card>
<a-card size="small" hoverable>
<p>身份证号:{{ walletData.card_number }}</p>
</a-card>
<a-card size="small" hoverable>
<p>支付宝账号:{{ walletData.alipay_account }}</p>
</a-card>
<a-card size="small" hoverable>
<p>支付宝姓名:{{ walletData.alipay_name }}</p>
</a-card>
</div>
</a-modal>
</template>
<script setup>
import { toRefs } from "vue";
import type { WalletData } from "@/types/index";
const props = withDefaults(
defineProps<{
visible: Boolean;
walletData: WalletData;
}>(),
{},
);
const { visible, walletData } = toRefs(props);
// 关闭弹窗
const emits = defineEmits(["closeDialog"]);
const closeDialogFn = (rest: boolean = false) => {
emits("closeDialog", "visibleStatus", rest);
};
</script>
<style scoped>
@import "SigningInfo.less";
</style>相关内容
为什么你家装的千兆网还...
带你了解并熟用Deepseek
C 盘最恶心的四大害虫,...
Astro 添加 Waline 评论组件
固态硬盘必做的SSD优化,...
iOS 可用的可换源小说阅读器
怎么复制网站(禁止鼠标右...
微信语音撤回不留痕迹
-
fastadmin基于ZipArchive生成压缩文件下载到本地
2021-05-25 2293
-
Wireshark - 网络抓包工具截取并分析各种网络数据包
2025-06-16 1308
-
macOS Sierra 10.12 显示允许任何来源 – 解决身份不明的开发者程序安装
2024-08-06 1723
-
终于有一款插件来处理B站烦人的广告了
2025-04-27 1324
-
你真的会使用百度搜索吗?
2021-11-22 823
-
将浏览器窗口变成简单的文本编辑器
2021-10-27 785
-
Vue3项目Build后部署在Nginx上F5刷新页面空白或404
2025-04-07 1239
-
最全ComfyUI资源整合:教程、插件、工作流(可免费体验)
2025-03-04 1748
-
微信免费听歌,畅享 QQ 音乐
2025-06-22 1306
-
Vue底层判断标签的性能优化方法
2025-04-07 1580
文章评论 (0)
- 这篇文章还没有收到评论,赶紧来抢沙发吧~


进入有缘空间
点击分享文章