首页 > 教程
Ant Design Vue 4.0 a-modal弹窗组件封装
- 2025-04-07
- 1051 ℃
父组件(部分)
<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>相关内容
macOS Sierra 10.12...
Ant Design Vue 4.0 ...
微信设置电子监护人,杜...
微信免费听歌,畅享 QQ 音乐
如何学习麻省理工学院课程
网页用JS屏蔽各种按键代码
ChromeAI – 无限量、...
医患纠纷案例解析与防范要点
-
微信支付钱给错了怎么办?
2025-06-22 1466
-
简单实用的电脑技巧,提高您的工作效率!
2021-10-27 952
-
人像摄影高级技巧合集
2025-10-24 655
-
3个DeepSeek隐藏玩法,99%的人都不知道
2025-04-30 1068
-
C 盘最恶心的四大害虫,随便一清就是几十个 G
2025-06-25 1239
-
你真的会使用百度搜索吗?
2021-11-22 748
-
Vue项目Element-UI表格el-table的分页el-pagination功能简单封装
2025-04-07 1048
-
电脑必装软件有哪些?请一定别错过这五款
2025-04-26 1055
-
微信公众号推送模板消息
2024-12-07 1485
-
能自动帮你过人机验证的工具
2025-04-27 1560
文章评论 (0)
- 这篇文章还没有收到评论,赶紧来抢沙发吧~


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