首页 > 教程
Ant Design Vue 4.0 a-modal弹窗组件封装
- 2025-04-07
- 1180 ℃
父组件(部分)
<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>相关内容
黑客万能优盘,自动破解...
拒绝软件捆绑,这些电脑...
微信开放平台第三方申请
JS正则常用校验大全
全面开放!开启微软新必...
网站没有配置SSL,访问ht...
HTML清除浮动的几种方法
如何与竞争对手合作
-
微信提现免手续费
2024-11-18 1494
-
可以下载中小学电子教材(教科书)的网站
2024-07-03 2387
-
PHP超级Ping API接口 源码
2025-04-07 1410
-
HTML清除浮动的几种方法
2025-04-07 1255
-
为什么你的AI助手总是答非所问?deepseek 应该怎样提问,让你轻松驾驭AI
2025-04-30 1142
-
离职时必须清理的电脑文件,不然你的秘密就被人看到了
2021-11-22 851
-
微信读书限制非会员,6招轻松破解导入上限
2025-04-27 6204
-
为什么当年历史课中西方史要分开学
2024-06-19 2058
-
可以长按进行倍速播放的本地视频播放器
2025-04-27 4281
-
国外网站怎么进入
2024-05-07 2443
文章评论 (0)
- 这篇文章还没有收到评论,赶紧来抢沙发吧~


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