首页 > 教程
Ant Design Vue 4.0 a-modal弹窗组件封装
- 2025-04-07
- 1016 ℃
父组件(部分)
<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能力翻倍...
易支付对接微信商户完整流程
Win7和Win10系统隐藏的上...
免费搭建最强网文神器网...
如何快速注册一个美国区A...
-
不备案可以在微信中直接打开的域名后缀
2024-03-04 2925
-
进化式产品创新
2024-05-29 1114
-
JS压缩图片并保留图片元信息
2025-04-07 1036
-
教你查询手机号绑定了哪些平台
2024-07-10 2337
-
边充电边玩手机会伤电池吗?
2025-07-03 1429
-
微信免费听歌,畅享 QQ 音乐
2025-06-22 1174
-
微信拍照模糊调用手机相机拍照更清晰
2025-06-22 1384
-
语音转文字,文字转语音,两极互转
2025-03-10 1251
-
显示器比例影响效率?16:10 比 16:9 更好用?
2024-07-17 4933
-
有没有好用的清理手机垃圾的软件呢
2025-03-10 1610
文章评论 (0)
- 这篇文章还没有收到评论,赶紧来抢沙发吧~


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